|
@ -5,8 +5,9 @@ class ShapeBase extends NodeBase { |
|
|
super(options, body, labelModule) |
|
|
super(options, body, labelModule) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_resizeShape(selected = this.selected, hover = this.hover, values = { size: this.options.size }) { |
|
|
|
|
|
|
|
|
resize(ctx, selected = this.selected, hover = this.hover, values = { size: this.options.size }) { |
|
|
if (this.needsRefresh(selected, hover)) { |
|
|
if (this.needsRefresh(selected, hover)) { |
|
|
|
|
|
this.labelModule.getTextSize(ctx, selected, hover); |
|
|
var size = 2 * values.size; |
|
|
var size = 2 * values.size; |
|
|
this.width = size; |
|
|
this.width = size; |
|
|
this.height = size; |
|
|
this.height = size; |
|
@ -15,7 +16,7 @@ class ShapeBase extends NodeBase { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover, values) { |
|
|
_drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover, values) { |
|
|
this._resizeShape(selected, hover, values); |
|
|
|
|
|
|
|
|
this.resize(ctx, selected, hover, values); |
|
|
|
|
|
|
|
|
this.left = x - this.width / 2; |
|
|
this.left = x - this.width / 2; |
|
|
this.top = y - this.height / 2; |
|
|
this.top = y - this.height / 2; |
|
|