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 From 5561e7cc43ae9f7cb9d1217ac02f9f136000e79c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 13 Apr 2012 13:37:17 -0700 Subject: fixed stage rotation Signed-off-by: Valerio Virgillito --- js/tools/RotateStage3DTool.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'js/tools/RotateStage3DTool.js') diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index adbf1b62..a980bf73 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -7,10 +7,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, Rotate3DToolBase = require("js/tools/Rotate3DToolBase").Rotate3DToolBase, toolHandleModule = require("js/stage/tool-handle"), - snapManager = require("js/helper-classes/3D/snap-manager").SnapManager, viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils, vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils, - drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils, ElementsMediator = require("js/mediators/element-mediator").ElementMediator; exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { @@ -23,6 +21,7 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { _initializeToolHandles: { value: function() { + this.rotateStage = true; if(!this._handles) { this._handles = []; @@ -149,6 +148,6 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { // this.UpdateSelection(true); this.Configure(true); } - } + } }); -- cgit v1.2.3