mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 18:27:58 +08:00
Merge branch 'drag-performance-improvement' of git://github.com/kzhdev/KineticJS into kzhdev-drag-performance-improvement
This commit is contained in:
@@ -227,7 +227,10 @@
|
|||||||
|
|
||||||
// if animation object has a function, execute it
|
// if animation object has a function, execute it
|
||||||
if(func) {
|
if(func) {
|
||||||
func.call(anim, anim.frame);
|
// allow anim bypassing drawing
|
||||||
|
if (false === func.call(anim, anim.frame)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,4 +297,4 @@
|
|||||||
layer.batchDraw();
|
layer.batchDraw();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
})(this);
|
})(this);
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
(function() {
|
(function() {
|
||||||
Kinetic.DD = {
|
Kinetic.DD = {
|
||||||
// properties
|
// properties
|
||||||
anim: new Kinetic.Animation(),
|
anim: new Kinetic.Animation(function(frame) {
|
||||||
|
var b = this.dirty;
|
||||||
|
this.dirty = false;
|
||||||
|
return b;
|
||||||
|
}),
|
||||||
isDragging: false,
|
isDragging: false,
|
||||||
justDragged: false,
|
justDragged: false,
|
||||||
offset: {
|
offset: {
|
||||||
@@ -136,6 +140,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.setAbsolutePosition(newNodePos);
|
this.setAbsolutePosition(newNodePos);
|
||||||
|
|
||||||
|
if (!this._lastPos ||
|
||||||
|
this._lastPos.x !== newNodePos.x ||
|
||||||
|
this._lastPos.y !== newNodePos.y) {
|
||||||
|
dd.anim.dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._lastPos = newNodePos;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user