diff options
Diffstat (limited to 'js/tools/drawing-tool-base.js')
-rwxr-xr-x | js/tools/drawing-tool-base.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js index 2283dfab..0b51aa28 100755 --- a/js/tools/drawing-tool-base.js +++ b/js/tools/drawing-tool-base.js | |||
@@ -41,11 +41,20 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
41 | 41 | ||
42 | // do the snap | 42 | // do the snap |
43 | var hitRec = snapManager.snap(x, y, true); | 43 | var hitRec = snapManager.snap(x, y, true); |
44 | var dragPlane; | ||
44 | if (hitRec) { | 45 | if (hitRec) { |
45 | // set up the working plane and convert the hit record to be working plane relative | 46 | // set up the working plane and convert the hit record to be working plane relative |
46 | var dragPlane = snapManager.setupDragPlanes( hitRec ); | 47 | if (hitRec.getElement() === snapManager.application.ninja.currentSelectedContainer) |
47 | var wpHitRec = hitRec.convertToWorkingPlane( dragPlane ); | 48 | { |
49 | dragPlane = viewUtils.getUnprojectedElementPlane( hitRec.getElement() ); | ||
50 | snapManager.setupDragPlaneFromPlane( dragPlane ); | ||
51 | } | ||
52 | else | ||
53 | { | ||
54 | dragPlane = snapManager.setupDragPlanes( hitRec ); | ||
55 | } | ||
48 | 56 | ||
57 | var wpHitRec = hitRec.convertToWorkingPlane( dragPlane ); | ||
49 | var pt = hitRec.getScreenPoint(); | 58 | var pt = hitRec.getScreenPoint(); |
50 | 59 | ||
51 | return( [wpHitRec, pt[0], pt[1]] ); | 60 | return( [wpHitRec, pt[0], pt[1]] ); |