From 0c34480bd135ab6ed9665c7966039589fd71f223 Mon Sep 17 00:00:00 2001 From: Rikard Bartholf Date: Thu, 18 May 2017 10:56:03 +0200 Subject: [PATCH] Temporary fix for avoid image "jumping" on initial dragging --- src/js/components/ImageEditor/Draggable.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/js/components/ImageEditor/Draggable.js b/src/js/components/ImageEditor/Draggable.js index 2abd1f1..6318771 100644 --- a/src/js/components/ImageEditor/Draggable.js +++ b/src/js/components/ImageEditor/Draggable.js @@ -28,6 +28,14 @@ function Draggable(img, boundingRect) { if (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.selectable = true; img.hoverCursor = 'move';