如何在停止后立即重新启用拖动?
this.layer = new Konva.Layer({draggable : true});
function myPosition() {
...
}
var that = this;
this.layer.dragBoundFunc(
function(pos) {
var y = pos.y;
if (y + myPosition()<0) {
this.stopDrag();
setTimeout(function() {that.layer.startDrag();}, 30);
}
if (y+myPosition()>50) {
this.stopDrag();
setTimeout(function() {that.layer.startDrag();}, 30);
}
return {
x : this.getAbsolutePosition().x,
y : y
};
});