mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
New anchorCornerRadius
for Konva.Transformer
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
'borderStrokeWidthChange',
|
||||
'anchorStrokeChange',
|
||||
'anchorStrokeWidthChange',
|
||||
'anchorFillChange'
|
||||
'anchorFillChange',
|
||||
'anchorCornerRadiusChange'
|
||||
].join(' ');
|
||||
|
||||
var NODE_RECT = 'nodeRect';
|
||||
@@ -123,6 +124,7 @@
|
||||
* @param {Array} [config.borderDash] Array for border dash.
|
||||
* @param {String} [config.anchorFill] Anchor fill color
|
||||
* @param {String} [config.anchorStroke] Anchor stroke color
|
||||
* @param {String} [config.anchorCornerRadius] Anchor corner radius
|
||||
* @param {Number} [config.anchorStrokeWidth] Anchor stroke size
|
||||
* @param {Number} [config.anchorSize] Default is 10
|
||||
* @param {Boolean} [config.keepRatio] Should we keep ratio when we are moving edges? Default is true
|
||||
@@ -712,7 +714,8 @@
|
||||
offsetY: anchorSize / 2,
|
||||
stroke: this.getAnchorStroke(),
|
||||
strokeWidth: this.getAnchorStrokeWidth(),
|
||||
fill: this.getAnchorFill()
|
||||
fill: this.getAnchorFill(),
|
||||
cornerRadius: this.getAnchorCornerRadius()
|
||||
});
|
||||
|
||||
this.findOne('.top-left').setAttrs({
|
||||
@@ -1026,6 +1029,27 @@
|
||||
*/
|
||||
Konva.Factory.addGetterSetter(Konva.Transformer, 'anchorFill', 'white');
|
||||
|
||||
/**
|
||||
* get/set anchor corner radius
|
||||
* @name anchorCornerRadius
|
||||
* @method
|
||||
* @memberof Konva.Transformer.prototype
|
||||
* @param {Number} enabled
|
||||
* @returns {Number}
|
||||
* @example
|
||||
* // get
|
||||
* var anchorCornerRadius = transformer.anchorCornerRadius();
|
||||
*
|
||||
* // set
|
||||
* transformer.anchorCornerRadius(3);
|
||||
*/
|
||||
Konva.Factory.addGetterSetter(
|
||||
Konva.Transformer,
|
||||
'anchorCornerRadius',
|
||||
0,
|
||||
Konva.Validators.getNumberValidator()
|
||||
);
|
||||
|
||||
/**
|
||||
* get/set border stroke color
|
||||
* @name borderStroke
|
||||
|
Reference in New Issue
Block a user