aboutsummaryrefslogtreecommitdiff
path: root/js/tools/drawing-tool-base.js
diff options
context:
space:
mode:
authorhwc4872012-05-01 11:03:56 -0700
committerhwc4872012-05-01 11:03:56 -0700
commitf6983a69649b1c274ce6fe2d278a325994d092b6 (patch)
treea360297930c35f3097af16e9f6714ec501bd5894 /js/tools/drawing-tool-base.js
parent80715f4f0c45d29926184fa02e0a01b4e7642a79 (diff)
parentfb47c04b0a4d65f53d975311754aa0dd8a8a3f69 (diff)
downloadninja-f6983a69649b1c274ce6fe2d278a325994d092b6.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Diffstat (limited to 'js/tools/drawing-tool-base.js')
-rwxr-xr-xjs/tools/drawing-tool-base.js13
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]] );