From 5914c5b2209c4b8daac4249bb76cda5c9314c4e6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 24 May 2012 00:07:23 -0700 Subject: Cleaning up referencing to 'documentRoot' and '_document' Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view. --- js/tools/RotateStage3DTool.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js/tools/RotateStage3DTool.js') diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index c8818021..92ed40d2 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -90,7 +90,7 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { this._origin = null; this._startOriginArray = null; - var stage = this.application.ninja.currentDocument.documentRoot; + var stage = this.application.ninja.currentDocument.model.documentRoot; this.target = stage; viewUtils.pushViewportObj( stage ); @@ -119,7 +119,7 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { captureElementChange: { value: function(event) { - if(event._event.item === this.application.ninja.currentDocument.documentRoot) + if(event._event.item === this.application.ninja.currentDocument.model.documentRoot) { this.captureSelectionDrawn(null); } @@ -132,9 +132,9 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { // Reset stage to identity matrix var iMat = Matrix.I(4); - ElementsMediator.setMatrix(this.application.ninja.currentDocument.documentRoot, + ElementsMediator.setMatrix(this.application.ninja.currentDocument.model.documentRoot, iMat, false, "rotateStage3DTool"); - this.application.ninja.currentDocument.documentRoot.elementModel.props3D.m_transformCtr = null; + this.application.ninja.currentDocument.model.documentRoot.elementModel.props3D.m_transformCtr = null; // let the document and stage manager know about the zoom change this.application.ninja.stage._firstDraw = true; -- cgit v1.2.3 From de25d2b7d05476d4f0d385b5e910db189f682d21 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 24 May 2012 13:34:12 -0700 Subject: IKNinja-1621 - 3D stage does not reset correctly when the rotation point is set elsewhere on stage. Signed-off-by: Nivesh Rajbhandari --- js/tools/RotateStage3DTool.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'js/tools/RotateStage3DTool.js') diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index c8818021..a9346c8e 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -130,20 +130,22 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { value : function() { // Reset stage to identity matrix - var iMat = Matrix.I(4); + var iMat = Matrix.I(4), + stage = this.application.ninja.stage; ElementsMediator.setMatrix(this.application.ninja.currentDocument.documentRoot, iMat, false, "rotateStage3DTool"); this.application.ninja.currentDocument.documentRoot.elementModel.props3D.m_transformCtr = null; // let the document and stage manager know about the zoom change - this.application.ninja.stage._firstDraw = true; + stage._firstDraw = true; this.application.ninja.documentBar.zoomFactor = 100; this.application.ninja.currentDocument.model.views.design.iframe.style.zoom = 1.0; - this.application.ninja.stage._firstDraw = false; + stage._firstDraw = false; - // TODO - Any updates to the stage should redraw stage's children. Move this to mediator? - this.application.ninja.stage.updatedStage = true; + viewUtils.clearStageTranslation(); + stage.centerStage(); + stage.draw(); this.isDrawing = false; this.endDraw(event); -- cgit v1.2.3