diff options
author | hwc487 | 2012-05-01 11:03:56 -0700 |
---|---|---|
committer | hwc487 | 2012-05-01 11:03:56 -0700 |
commit | f6983a69649b1c274ce6fe2d278a325994d092b6 (patch) | |
tree | a360297930c35f3097af16e9f6714ec501bd5894 /js/tools/drawing-tool-base.js | |
parent | 80715f4f0c45d29926184fa02e0a01b4e7642a79 (diff) | |
parent | fb47c04b0a4d65f53d975311754aa0dd8a8a3f69 (diff) | |
download | ninja-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-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]] ); |