mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
add transformstart event
This commit is contained in:
parent
0d12e94053
commit
4b70236652
19
konva.js
19
konva.js
@ -2,7 +2,7 @@
|
||||
* Konva JavaScript Framework v1.7.6
|
||||
* http://konvajs.github.io/
|
||||
* Licensed under the MIT
|
||||
* Date: Thu Mar 08 2018
|
||||
* Date: Sat Mar 10 2018
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
||||
@ -18444,10 +18444,10 @@
|
||||
// bindings
|
||||
this.handleMouseMove = this.handleMouseMove.bind(this);
|
||||
this.handleMouseUp = this.handleMouseUp.bind(this);
|
||||
this._update = this._update.bind(this);
|
||||
this.update = this.update.bind(this);
|
||||
|
||||
// update transformer data for certain attr changes
|
||||
this.on(ATTR_CHANGE_LIST, this._update);
|
||||
this.on(ATTR_CHANGE_LIST, this.update);
|
||||
|
||||
if (!warningShowed) {
|
||||
Konva.Util.warn(
|
||||
@ -18462,10 +18462,10 @@
|
||||
this.detach();
|
||||
}
|
||||
this.setNode(node);
|
||||
node.on('dragmove.resizer', this._update);
|
||||
node.on(TRANSFORM_CHANGE_STR, this._update);
|
||||
node.on('dragmove.resizer', this.update);
|
||||
node.on(TRANSFORM_CHANGE_STR, this.update);
|
||||
|
||||
this._update();
|
||||
this.update();
|
||||
},
|
||||
|
||||
detach: function() {
|
||||
@ -18601,6 +18601,9 @@
|
||||
window.addEventListener('touchend', this.handleMouseUp);
|
||||
|
||||
this._transforming = true;
|
||||
|
||||
this.fire('transformstart');
|
||||
this.getNode().fire('transformstart');
|
||||
},
|
||||
|
||||
handleMouseMove: function(e) {
|
||||
@ -18809,10 +18812,10 @@
|
||||
|
||||
this.fire('transform');
|
||||
this.getNode().fire('transform');
|
||||
this._update();
|
||||
this.update();
|
||||
this.getLayer().batchDraw();
|
||||
},
|
||||
_update: function() {
|
||||
update: function() {
|
||||
var attrs = this._getNodeRect();
|
||||
var x = attrs.x;
|
||||
var y = attrs.y;
|
||||
|
6
konva.min.js
vendored
6
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -103,10 +103,10 @@
|
||||
// bindings
|
||||
this.handleMouseMove = this.handleMouseMove.bind(this);
|
||||
this.handleMouseUp = this.handleMouseUp.bind(this);
|
||||
this._update = this._update.bind(this);
|
||||
this.update = this.update.bind(this);
|
||||
|
||||
// update transformer data for certain attr changes
|
||||
this.on(ATTR_CHANGE_LIST, this._update);
|
||||
this.on(ATTR_CHANGE_LIST, this.update);
|
||||
|
||||
if (!warningShowed) {
|
||||
Konva.Util.warn(
|
||||
@ -121,10 +121,10 @@
|
||||
this.detach();
|
||||
}
|
||||
this.setNode(node);
|
||||
node.on('dragmove.resizer', this._update);
|
||||
node.on(TRANSFORM_CHANGE_STR, this._update);
|
||||
node.on('dragmove.resizer', this.update);
|
||||
node.on(TRANSFORM_CHANGE_STR, this.update);
|
||||
|
||||
this._update();
|
||||
this.update();
|
||||
},
|
||||
|
||||
detach: function() {
|
||||
@ -260,6 +260,9 @@
|
||||
window.addEventListener('touchend', this.handleMouseUp);
|
||||
|
||||
this._transforming = true;
|
||||
|
||||
this.fire('transformstart');
|
||||
this.getNode().fire('transformstart');
|
||||
},
|
||||
|
||||
handleMouseMove: function(e) {
|
||||
@ -468,10 +471,10 @@
|
||||
|
||||
this.fire('transform');
|
||||
this.getNode().fire('transform');
|
||||
this._update();
|
||||
this.update();
|
||||
this.getLayer().batchDraw();
|
||||
},
|
||||
_update: function() {
|
||||
update: function() {
|
||||
var attrs = this._getNodeRect();
|
||||
var x = attrs.x;
|
||||
var y = attrs.y;
|
||||
|
Loading…
Reference in New Issue
Block a user