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(-) 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