aboutsummaryrefslogtreecommitdiff
path: root/js/tools/modifier-tool-base.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/modifier-tool-base.js')
-rwxr-xr-xjs/tools/modifier-tool-base.js45
1 files changed, 23 insertions, 22 deletions
diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js
index 55baecc8..7a4814a6 100755
--- a/js/tools/modifier-tool-base.js
+++ b/js/tools/modifier-tool-base.js
@@ -1,24 +1,25 @@
1/* <copyright> 1/* <copyright>
2Copyright (c) 2012, Motorola Mobility, Inc 2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved. 3All Rights Reserved.
4BSD License.
5 4
6Redistribution and use in source and binary forms, with or without 5Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met: 6modification, are permitted provided that the following conditions are met:
8 7
9 - Redistributions of source code must retain the above copyright notice, 8* Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer. 9 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright 10
12 notice, this list of conditions and the following disclaimer in the 11* Redistributions in binary form must reproduce the above copyright notice,
13 documentation and/or other materials provided with the distribution. 12 this list of conditions and the following disclaimer in the documentation
14 - Neither the name of Motorola Mobility nor the names of its contributors 13 and/or other materials provided with the distribution.
15 may be used to endorse or promote products derived from this software 14
16 without specific prior written permission. 15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
17 18
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -81,7 +82,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
81 } 82 }
82 } 83 }
83 }, 84 },
84 85
85 _getObjectBeingTracked : 86 _getObjectBeingTracked :
86 { 87 {
87 value: function(hitRec) 88 value: function(hitRec)
@@ -103,7 +104,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
103 // override in subclasses 104 // override in subclasses
104 } 105 }
105 }, 106 },
106 107
107 initializeSnapping: 108 initializeSnapping:
108 { 109 {
109 value: function(event) 110 value: function(event)
@@ -222,7 +223,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
222 } 223 }
223 } 224 }
224 }, 225 },
225 226
226 /* 227 /*
227 * The parameterization is based on the position of the 228 * The parameterization is based on the position of the
228 * snap point in pre-transformed element screen space 229 * snap point in pre-transformed element screen space
@@ -313,7 +314,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
313 var localPt = [x,y,z]; 314 var localPt = [x,y,z];
314 315
315 globalPt = viewUtils.localToGlobal( localPt, elt ); 316 globalPt = viewUtils.localToGlobal( localPt, elt );
316 317
317 // add in the delta 318 // add in the delta
318 var hitPt = this.GetObjectHitPoint(); 319 var hitPt = this.GetObjectHitPoint();
319 var scrPt = viewUtils.localToGlobal( hitPt, this._clickedObject ); 320 var scrPt = viewUtils.localToGlobal( hitPt, this._clickedObject );
@@ -375,7 +376,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
375 viewUtils.pushViewportObj( elt ); 376 viewUtils.pushViewportObj( elt );
376 var viewPt = viewUtils.screenToView( scrPt[0], scrPt[1], scrPt[2] ); 377 var viewPt = viewUtils.screenToView( scrPt[0], scrPt[1], scrPt[2] );
377 viewUtils.popViewportObj(); 378 viewUtils.popViewportObj();
378 379
379 if(useViewPoint) 380 if(useViewPoint)
380 { 381 {
381 return viewPt; 382 return viewPt;
@@ -405,7 +406,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
405 viewUtils.pushViewportObj( elt ); 406 viewUtils.pushViewportObj( elt );
406 var viewPt = viewUtils.screenToView( scrPt[0], scrPt[1], scrPt[2] ); 407 var viewPt = viewUtils.screenToView( scrPt[0], scrPt[1], scrPt[2] );
407 viewUtils.popViewportObj(); 408 viewUtils.popViewportObj();
408 409
409 if(useViewPoint) 410 if(useViewPoint)
410 { 411 {
411 return viewPt; 412 return viewPt;
@@ -593,7 +594,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
593 } 594 }
594 } 595 }
595 }, 596 },
596 597
597 doDraw: { 598 doDraw: {
598 value: function(event) 599 value: function(event)
599 { 600 {
@@ -627,12 +628,12 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
627 this._mode = 0; 628 this._mode = 0;
628 } 629 }
629 }, 630 },
630 631
631 cleanupSnap: { 632 cleanupSnap: {
632 value: function() { 633 value: function() {
633 this.mouseDownHitRec = null; 634 this.mouseDownHitRec = null;
634 this.mouseUpHitRec = null; 635 this.mouseUpHitRec = null;
635 636
636 this._dragPlane = null; 637 this._dragPlane = null;
637 this._useQuadPt = false; 638 this._useQuadPt = false;
638 639
@@ -742,7 +743,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
742 } 743 }
743 }, 744 },
744 //------------------------------------------------------------------------- 745 //-------------------------------------------------------------------------
745 746
746 //------------------------------------------------------------------------- 747 //-------------------------------------------------------------------------
747 // Routines to run when tool is selected/deselected 748 // Routines to run when tool is selected/deselected
748 Configure: { 749 Configure: {
@@ -867,7 +868,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
867 868
868 if (!this._isDrawing || (this.application.ninja.selectedElements.length == 1)) 869 if (!this._isDrawing || (this.application.ninja.selectedElements.length == 1))
869 this.DrawHandles(this._delta); 870 this.DrawHandles(this._delta);
870 871
871 if(this._canSnap) 872 if(this._canSnap)
872 { 873 {
873 snapManager.drawLastHit(); 874 snapManager.drawLastHit();