From 2c04935f0ccb1cb7c98371fc10b43155f2d956c4 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 1 Mar 2012 22:20:06 -0800 Subject: Fix for elements flying off into space when moving elements that overlap. This was happening because our hit record's element and the browser's element from point did not match. Signed-off-by: Nivesh Rajbhandari --- js/tools/modifier-tool-base.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'js/tools/modifier-tool-base.js') diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index 7d946cb0..7892d015 100755 --- a/js/tools/modifier-tool-base.js +++ b/js/tools/modifier-tool-base.js @@ -133,6 +133,13 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { // a snap on the mouse down var hitRec = snapManager.snap(point.x, point.y, do3DSnap); + // TODO - Check that hitRec's element matches element that browser says we clicked on + var elt = this.application.ninja.stage.GetElement(event); + if(elt !== hitRec.getElement()) + { + hitRec = snapManager.findHitRecordForElement(elt); + } + // we don't want to snap to selected objects during the drag var len = this._targets.length; for(var i=0; i