diff options
author | Valerio Virgillito | 2012-04-13 00:30:19 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-04-13 00:30:19 -0700 |
commit | f91e64235eb03c889ff4f5577c3e3480cd0d787f (patch) | |
tree | 946cfe53bd9281478f32c7a446c1c803383d8d17 /js/tools/RotateStage3DTool.js | |
parent | 5b4826eced782fe7b4691d4bbbe0e3605d3164c1 (diff) | |
download | ninja-f91e64235eb03c889ff4f5577c3e3480cd0d787f.tar.gz |
removing _undo array and _targets array and use object instead of matching arrays to set properties
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/tools/RotateStage3DTool.js')
-rwxr-xr-x | js/tools/RotateStage3DTool.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index f5cc4040..adbf1b62 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js | |||
@@ -62,7 +62,6 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { | |||
62 | 62 | ||
63 | _updateTargets: { | 63 | _updateTargets: { |
64 | value: function(addToUndoStack) { | 64 | value: function(addToUndoStack) { |
65 | this._targets = []; | ||
66 | var elt = this._target; | 65 | var elt = this._target; |
67 | 66 | ||
68 | var curMat = viewUtils.getMatrixFromElement(elt); | 67 | var curMat = viewUtils.getMatrixFromElement(elt); |
@@ -74,7 +73,9 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { | |||
74 | 73 | ||
75 | eltCtr = viewUtils.localToGlobal(eltCtr, elt); | 74 | eltCtr = viewUtils.localToGlobal(eltCtr, elt); |
76 | 75 | ||
77 | this._targets.push({elt:elt, mat:curMat, matInv:curMatInv, ctr:eltCtr}); | 76 | elt.elementModel.setProperty("mat", curMat); |
77 | elt.elementModel.setProperty("matInv", curMatInv); | ||
78 | elt.elementModel.setProperty("ctr", eltCtr); | ||
78 | 79 | ||
79 | ElementsMediator.setMatrix(elt, curMat, false, "rotateStage3DTool"); | 80 | ElementsMediator.setMatrix(elt, curMat, false, "rotateStage3DTool"); |
80 | } | 81 | } |
@@ -83,7 +84,6 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { | |||
83 | captureSelectionDrawn: { | 84 | captureSelectionDrawn: { |
84 | value: function(event){ | 85 | value: function(event){ |
85 | this._origin = null; | 86 | this._origin = null; |
86 | this._targets = []; | ||
87 | this._startOriginArray = null; | 87 | this._startOriginArray = null; |
88 | 88 | ||
89 | var stage = this.application.ninja.currentDocument.documentRoot; | 89 | var stage = this.application.ninja.currentDocument.documentRoot; |
@@ -93,12 +93,12 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { | |||
93 | var eltCtr = viewUtils.getCenterOfProjection(); | 93 | var eltCtr = viewUtils.getCenterOfProjection(); |
94 | viewUtils.popViewportObj(); | 94 | viewUtils.popViewportObj(); |
95 | 95 | ||
96 | this._targets = []; | ||
97 | |||
98 | var curMat = viewUtils.getMatrixFromElement(stage); | 96 | var curMat = viewUtils.getMatrixFromElement(stage); |
99 | var curMatInv = glmat4.inverse(curMat, []); | 97 | var curMatInv = glmat4.inverse(curMat, []); |
100 | 98 | ||
101 | this._targets.push({elt:stage, mat:curMat, matInv:curMatInv, ctr:eltCtr}); | 99 | stage.elementModel.setProperty("mat", curMat); |
100 | stage.elementModel.setProperty("matInv", curMatInv); | ||
101 | stage.elementModel.setProperty("ctr", eltCtr); | ||
102 | 102 | ||
103 | var ctrOffset = stage.elementModel.props3D.m_transformCtr; | 103 | var ctrOffset = stage.elementModel.props3D.m_transformCtr; |
104 | if(ctrOffset) | 104 | if(ctrOffset) |