|
@ -44,9 +44,8 @@ class Icon extends NodeBase { |
|
|
|
|
|
|
|
|
_icon(ctx, x, y, selected) { |
|
|
_icon(ctx, x, y, selected) { |
|
|
let iconSize = Number(this.options.icon.size); |
|
|
let iconSize = Number(this.options.icon.size); |
|
|
let relativeIconSize = iconSize * this.body.view.scale; |
|
|
|
|
|
|
|
|
|
|
|
if (this.options.icon.code && relativeIconSize > this.options.scaling.label.drawThreshold - 1) { |
|
|
|
|
|
|
|
|
if (this.options.icon.code !== undefined) { |
|
|
ctx.font = (selected ? "bold " : "") + iconSize + "px " + this.options.icon.face; |
|
|
ctx.font = (selected ? "bold " : "") + iconSize + "px " + this.options.icon.face; |
|
|
|
|
|
|
|
|
// draw icon
|
|
|
// draw icon
|
|
@ -62,6 +61,10 @@ class Icon extends NodeBase { |
|
|
// disable shadows for other elements.
|
|
|
// disable shadows for other elements.
|
|
|
this.disableShadow(ctx); |
|
|
this.disableShadow(ctx); |
|
|
} |
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
console.error('When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
distanceToBorder(ctx, angle) { |
|
|
distanceToBorder(ctx, angle) { |
|
|