mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
fix stop transform bug
This commit is contained in:
parent
32dec19f51
commit
8420e44c1b
@ -5,7 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## [new version][unreleased]
|
## [new version][unreleased]
|
||||||
|
|
||||||
## [2.2.0][2018-08-10]
|
## [2.2.1][2018-08-10]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
'borderStrokeChange',
|
'borderStrokeChange',
|
||||||
'borderStrokeWidthChange',
|
'borderStrokeWidthChange',
|
||||||
'anchorStrokeChange',
|
'anchorStrokeChange',
|
||||||
'anchorStrokeWidthChange'
|
'anchorStrokeWidthChange',
|
||||||
|
'anchorFillChange'
|
||||||
].join(' ');
|
].join(' ');
|
||||||
|
|
||||||
var NODE_RECT = 'nodeRect';
|
var NODE_RECT = 'nodeRect';
|
||||||
@ -105,7 +106,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transformer constructor. Transformer is a special type of group that allow you transform Konva
|
* Transformer constructor. Transformer is a special type of group that allow you transform Konva
|
||||||
* primitives and shapes.
|
* primitives and shapes. Transforming tool is not changing `width` and `height` properties of nodes
|
||||||
|
* when you resize them. Instead it changes `scaleX` and `scaleY` properties.
|
||||||
* @constructor
|
* @constructor
|
||||||
* @memberof Konva
|
* @memberof Konva
|
||||||
* @param {Object} config
|
* @param {Object} config
|
||||||
@ -118,7 +120,8 @@
|
|||||||
* @param {String} [config.borderStroke] Border stroke color
|
* @param {String} [config.borderStroke] Border stroke color
|
||||||
* @param {Number} [config.borderStrokeWidth] Border stroke size
|
* @param {Number} [config.borderStrokeWidth] Border stroke size
|
||||||
* @param {Array} [config.borderDash] Array for border dash.
|
* @param {Array} [config.borderDash] Array for border dash.
|
||||||
* @param {Number} [config.anchorStroke] Anchor stroke color
|
* @param {String} [config.anchorFill] Anchor fill color
|
||||||
|
* @param {String} [config.anchorStroke] Anchor stroke color
|
||||||
* @param {Number} [config.anchorStrokeWidth] Anchor stroke size
|
* @param {Number} [config.anchorStrokeWidth] Anchor stroke size
|
||||||
* @param {Number} [config.anchorSize] Default is 10
|
* @param {Number} [config.anchorSize] Default is 10
|
||||||
* @param {Boolean} [config.keepRatio] Should we keep ratio when we are moving edges? Default is true
|
* @param {Boolean} [config.keepRatio] Should we keep ratio when we are moving edges? Default is true
|
||||||
@ -318,6 +321,12 @@
|
|||||||
anchor.on('dragstart', function(e) {
|
anchor.on('dragstart', function(e) {
|
||||||
e.cancelBubble = true;
|
e.cancelBubble = true;
|
||||||
});
|
});
|
||||||
|
anchor.on('dragmove', function(e) {
|
||||||
|
e.cancelBubble = true;
|
||||||
|
});
|
||||||
|
anchor.on('dragend', function(e) {
|
||||||
|
e.cancelBubble = true;
|
||||||
|
});
|
||||||
|
|
||||||
// add hover styling
|
// add hover styling
|
||||||
anchor.on('mouseenter', function() {
|
anchor.on('mouseenter', function() {
|
||||||
@ -774,6 +783,10 @@
|
|||||||
stopTransform: function() {
|
stopTransform: function() {
|
||||||
if (this._transforming) {
|
if (this._transforming) {
|
||||||
this._removeEvents();
|
this._removeEvents();
|
||||||
|
var resizerNode = this.findOne('.' + this.movingResizer);
|
||||||
|
if (resizerNode) {
|
||||||
|
resizerNode.stopDrag();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user