From f91e64235eb03c889ff4f5577c3e3480cd0d787f Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 13 Apr 2012 00:30:19 -0700 Subject: removing _undo array and _targets array and use object instead of matching arrays to set properties Signed-off-by: Valerio Virgillito --- js/tools/RotateStage3DTool.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'js/tools/RotateStage3DTool.js') 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, { _updateTargets: { value: function(addToUndoStack) { - this._targets = []; var elt = this._target; var curMat = viewUtils.getMatrixFromElement(elt); @@ -74,7 +73,9 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { eltCtr = viewUtils.localToGlobal(eltCtr, elt); - this._targets.push({elt:elt, mat:curMat, matInv:curMatInv, ctr:eltCtr}); + elt.elementModel.setProperty("mat", curMat); + elt.elementModel.setProperty("matInv", curMatInv); + elt.elementModel.setProperty("ctr", eltCtr); ElementsMediator.setMatrix(elt, curMat, false, "rotateStage3DTool"); } @@ -83,7 +84,6 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { captureSelectionDrawn: { value: function(event){ this._origin = null; - this._targets = []; this._startOriginArray = null; var stage = this.application.ninja.currentDocument.documentRoot; @@ -93,12 +93,12 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { var eltCtr = viewUtils.getCenterOfProjection(); viewUtils.popViewportObj(); - this._targets = []; - var curMat = viewUtils.getMatrixFromElement(stage); var curMatInv = glmat4.inverse(curMat, []); - this._targets.push({elt:stage, mat:curMat, matInv:curMatInv, ctr:eltCtr}); + stage.elementModel.setProperty("mat", curMat); + stage.elementModel.setProperty("matInv", curMatInv); + stage.elementModel.setProperty("ctr", eltCtr); var ctrOffset = stage.elementModel.props3D.m_transformCtr; if(ctrOffset) -- cgit v1.2.3