aboutsummaryrefslogtreecommitdiff
path: root/js/tools/Rotate3DToolBase.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/Rotate3DToolBase.js')
-rwxr-xr-xjs/tools/Rotate3DToolBase.js37
1 files changed, 19 insertions, 18 deletions
diff --git a/js/tools/Rotate3DToolBase.js b/js/tools/Rotate3DToolBase.js
index 60dcdc6a..4afe47eb 100755
--- a/js/tools/Rotate3DToolBase.js
+++ b/js/tools/Rotate3DToolBase.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
@@ -232,7 +233,7 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, {
232 } 233 }
233 234
234 this.DrawHandles(this._delta); 235 this.DrawHandles(this._delta);
235 236
236 if(this._canSnap) 237 if(this._canSnap)
237 { 238 {
238 snapManager.drawLastHit(); 239 snapManager.drawLastHit();
@@ -380,7 +381,7 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, {
380 var tMat = Matrix.I(4); 381 var tMat = Matrix.I(4);
381 382
382 // _startOriginArray is the location of the center of rotation 383 // _startOriginArray is the location of the center of rotation
383 // in view space of the element. 384 // in view space of the element.
384 var transformCtr = this._startOriginArray[i]; 385 var transformCtr = this._startOriginArray[i];
385 386
386 tMat[12] = transformCtr[0]; 387 tMat[12] = transformCtr[0];
@@ -497,7 +498,7 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, {
497 eltCtr[2] = 0; 498 eltCtr[2] = 0;
498 eltCtr = vecUtils.vecAdd(3, eltCtr, ctrOffset); 499 eltCtr = vecUtils.vecAdd(3, eltCtr, ctrOffset);
499 } 500 }
500 501
501 this._origin = viewUtils.localToGlobal(eltCtr, this.target); 502 this._origin = viewUtils.localToGlobal(eltCtr, this.target);
502 //console.log( "Rotate3DToolBase.captureSelectionDrawn _origin: " + this._origin ); 503 //console.log( "Rotate3DToolBase.captureSelectionDrawn _origin: " + this._origin );
503 this._updateTargets(); 504 this._updateTargets();
@@ -579,7 +580,7 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, {
579 } 580 }
580 }, 581 },
581 582
582 calculateMultiSelOrigin: 583 calculateMultiSelOrigin:
583 { 584 {
584 value: function() 585 value: function()
585 { 586 {
@@ -637,9 +638,9 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, {
637 } else { 638 } else {
638 element = this.application.ninja.selectedElements[0]; 639 element = this.application.ninja.selectedElements[0];
639 } 640 }
640 641
641 if(shouldUpdateCenter) { 642 if(shouldUpdateCenter) {
642 643
643// eltCtr = element.elementModel.getProperty("ctr"); 644// eltCtr = element.elementModel.getProperty("ctr");
644// ctrOffset = vecUtils.vecSubtract(3, this._origin, eltCtr); 645// ctrOffset = vecUtils.vecSubtract(3, this._origin, eltCtr);
645 646
@@ -667,7 +668,7 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, {
667 this._startOriginArray[i] = ctrOffset; 668 this._startOriginArray[i] = ctrOffset;
668 } 669 }
669 */ 670 */
670 671
671 // Update transform ctr for all elements if transform origin was modified 672 // Update transform ctr for all elements if transform origin was modified
672 if (!this._origin) this._origin = this.calculateMultiSelOrigin(); 673 if (!this._origin) this._origin = this.calculateMultiSelOrigin();
673 var globalCtr = this._origin; 674 var globalCtr = this._origin;