restore 'empty' drag algorithm

This commit is contained in:
Лаврёнов Антон 2014-05-08 18:34:38 +08:00
parent 3f0e89cd95
commit d82ec329e9
2 changed files with 6 additions and 4 deletions

View File

@ -27,7 +27,6 @@
Math.abs(pos.x - dd.startPointerPos.x), Math.abs(pos.x - dd.startPointerPos.x),
Math.abs(pos.y - dd.startPointerPos.y) Math.abs(pos.y - dd.startPointerPos.y)
); );
if (distance < dragDistance) { if (distance < dragDistance) {
return; return;
} }
@ -138,11 +137,10 @@
if(dbf !== undefined) { if(dbf !== undefined) {
newNodePos = dbf.call(this, newNodePos, evt); newNodePos = dbf.call(this, newNodePos, evt);
} }
this.setAbsolutePosition(newNodePos); this.setAbsolutePosition(newNodePos);
if (this._lastPos && this._lastPos.x === newNodePos.x && if (!this._lastPos || this._lastPos.x !== newNodePos.x ||
this._lastPos.y === newNodePos.y) { this._lastPos.y !== newNodePos.y) {
dd.anim.dirty = true; dd.anim.dirty = true;
} }

View File

@ -235,6 +235,10 @@ var Kinetic = {};
* @param {Object} config * @param {Object} config
* @param {Boolean} [config.clearBeforeDraw] set this property to false if you don't want * @param {Boolean} [config.clearBeforeDraw] set this property to false if you don't want
* to clear the canvas before each layer draw. The default value is true. * to clear the canvas before each layer draw. The default value is true.
* @param {Boolean} [config.visible]
* @param {String} [config.id] unique id
* @param {String} [config.name] non-unique name
* @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1
* @@containerParams * @@containerParams
* @example * @example
* var layer = new Kinetic.FastLayer(); * var layer = new Kinetic.FastLayer();