mirror of
https://github.com/konvajs/konva.git
synced 2025-12-19 10:58:20 +08:00
fixes
This commit is contained in:
26
konva.js
26
konva.js
@@ -18482,6 +18482,8 @@
|
|||||||
window.addEventListener('touchmove', this.handleMouseMove);
|
window.addEventListener('touchmove', this.handleMouseMove);
|
||||||
window.addEventListener('mouseup', this.handleMouseUp);
|
window.addEventListener('mouseup', this.handleMouseUp);
|
||||||
window.addEventListener('touchend', this.handleMouseUp);
|
window.addEventListener('touchend', this.handleMouseUp);
|
||||||
|
|
||||||
|
this._transforming = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
handleMouseMove: function(e) {
|
handleMouseMove: function(e) {
|
||||||
@@ -18642,12 +18644,19 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleMouseUp: function() {
|
handleMouseUp: function() {
|
||||||
this.fire('transformend');
|
this._removeEvents();
|
||||||
this._el.fire('transformend');
|
},
|
||||||
window.removeEventListener('mousemove', this.handleMouseMove);
|
|
||||||
window.removeEventListener('touchmove', this.handleMouseMove);
|
_removeEvents: function() {
|
||||||
window.removeEventListener('mouseup', this.handleMouseUp);
|
if (this._transforming) {
|
||||||
window.removeEventListener('touchend', this.handleMouseUp);
|
this.fire('transformend');
|
||||||
|
this._el.fire('transformend');
|
||||||
|
window.removeEventListener('mousemove', this.handleMouseMove);
|
||||||
|
window.removeEventListener('touchmove', this.handleMouseMove);
|
||||||
|
window.removeEventListener('mouseup', this.handleMouseUp);
|
||||||
|
window.removeEventListener('touchend', this.handleMouseUp);
|
||||||
|
}
|
||||||
|
this._transforming = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
_getAttrs: function() {
|
_getAttrs: function() {
|
||||||
@@ -18771,10 +18780,7 @@
|
|||||||
destroy: function() {
|
destroy: function() {
|
||||||
Konva.Group.prototype.destroy.call(this);
|
Konva.Group.prototype.destroy.call(this);
|
||||||
this._el.off('.resizer');
|
this._el.off('.resizer');
|
||||||
window.removeEventListener('mousemove', this.handleMouseMove);
|
this._removeEvents();
|
||||||
window.removeEventListener('touchmove', this.handleMouseMove);
|
|
||||||
window.removeEventListener('mouseup', this.handleMouseUp);
|
|
||||||
window.removeEventListener('touchend', this.handleMouseUp);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Konva.Util.extend(Konva.Transformer, Konva.Group);
|
Konva.Util.extend(Konva.Transformer, Konva.Group);
|
||||||
|
|||||||
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -151,6 +151,8 @@
|
|||||||
window.addEventListener('touchmove', this.handleMouseMove);
|
window.addEventListener('touchmove', this.handleMouseMove);
|
||||||
window.addEventListener('mouseup', this.handleMouseUp);
|
window.addEventListener('mouseup', this.handleMouseUp);
|
||||||
window.addEventListener('touchend', this.handleMouseUp);
|
window.addEventListener('touchend', this.handleMouseUp);
|
||||||
|
|
||||||
|
this._transforming = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
handleMouseMove: function(e) {
|
handleMouseMove: function(e) {
|
||||||
@@ -311,12 +313,19 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleMouseUp: function() {
|
handleMouseUp: function() {
|
||||||
this.fire('transformend');
|
this._removeEvents();
|
||||||
this._el.fire('transformend');
|
},
|
||||||
window.removeEventListener('mousemove', this.handleMouseMove);
|
|
||||||
window.removeEventListener('touchmove', this.handleMouseMove);
|
_removeEvents: function() {
|
||||||
window.removeEventListener('mouseup', this.handleMouseUp);
|
if (this._transforming) {
|
||||||
window.removeEventListener('touchend', this.handleMouseUp);
|
this.fire('transformend');
|
||||||
|
this._el.fire('transformend');
|
||||||
|
window.removeEventListener('mousemove', this.handleMouseMove);
|
||||||
|
window.removeEventListener('touchmove', this.handleMouseMove);
|
||||||
|
window.removeEventListener('mouseup', this.handleMouseUp);
|
||||||
|
window.removeEventListener('touchend', this.handleMouseUp);
|
||||||
|
}
|
||||||
|
this._transforming = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
_getAttrs: function() {
|
_getAttrs: function() {
|
||||||
@@ -440,10 +449,7 @@
|
|||||||
destroy: function() {
|
destroy: function() {
|
||||||
Konva.Group.prototype.destroy.call(this);
|
Konva.Group.prototype.destroy.call(this);
|
||||||
this._el.off('.resizer');
|
this._el.off('.resizer');
|
||||||
window.removeEventListener('mousemove', this.handleMouseMove);
|
this._removeEvents();
|
||||||
window.removeEventListener('touchmove', this.handleMouseMove);
|
|
||||||
window.removeEventListener('mouseup', this.handleMouseUp);
|
|
||||||
window.removeEventListener('touchend', this.handleMouseUp);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Konva.Util.extend(Konva.Transformer, Konva.Group);
|
Konva.Util.extend(Konva.Transformer, Konva.Group);
|
||||||
|
|||||||
Reference in New Issue
Block a user