dragDistance does not stop calls to DragBoundFunc
Hi,
I had to add !dd.isDragging to stop calls to DragBoundFunc, Do you agree that that this is the correct behavior?
Cheers, ML
Kinetic.Node.prototype._setDragPosition = function(evt) {
var dd = Kinetic.DD,
pos = this.getStage().getPointerPosition(),
dbf = this.getDragBoundFunc();
if (!pos || !dd.isDragging) {
return;
}
var newNodePos = {
x: pos.x - dd.offset.x,
y: pos.y - dd.offset.y
};
if(dbf !== undefined) {
newNodePos = dbf.call(this, newNodePos, evt);
}
this.setAbsolutePosition(newNodePos);
};
I think dragDistance should be relative to dragBoundFunc. Do you have an example where your behaviour is important?
I have the same problem. I my case, I am developing a browser game with KineticJS in which it is important that dragBoundFunc is only called when an object was actually moved.
Although I could also take a detour via "drag move" and realize my own dragBoundFunc-alternative, but this would mean a lot of effort for me. It would be great if this bug will be fixed in the next version of KineticJS.
@lavrton If there are also uses for relative behavior, then there should be an option for this. Currently behaves dragDistance not relative to dragBoundFunc.