Temporary fix for avoid image "jumping" on initial dragging

This commit is contained in:
Rikard Bartholf
2017-05-18 10:56:03 +02:00
parent a31de5835d
commit 0c34480bd1
@@ -28,6 +28,14 @@ function Draggable(img, boundingRect) {
if (localBoundingRect) { if (localBoundingRect) {
_bounds = localBoundingRect; _bounds = localBoundingRect;
} }
// @TODO Refactor this, see Viewport.calcMinMaxBoundsForRect
if (img.canvas.getViewport().getData().axis === 'h') {
_bounds.top.min = _bounds.top.max = img.top;
} else {
_bounds.left.min = _bounds.left.max = img.left;
}
img.lockMovementX = img.lockMovementY = false; img.lockMovementX = img.lockMovementY = false;
img.selectable = true; img.selectable = true;
img.hoverCursor = 'move'; img.hoverCursor = 'move';