From 8f8f7f9a36fb9abadea2a9f25aef0084946bebc9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 4 May 2012 14:42:00 -0700 Subject: Removed special-casing for new template workflow. Instead, we will enforce a width and height on the body in order to do 3d. Signed-off-by: Nivesh Rajbhandari --- js/tools/RotateStage3DTool.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'js/tools/RotateStage3DTool.js') diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index 2a9c63db..90cbe95e 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -96,12 +96,6 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { viewUtils.pushViewportObj( stage ); var eltCtr = viewUtils.getCenterOfProjection(); viewUtils.popViewportObj(); -// if(this.application.ninja.documentController.webTemplate) - if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") - { - eltCtr[0] = stage.scrollWidth/2; - eltCtr[1] = stage.scrollHeight/2; - } var curMat = viewUtils.getMatrixFromElement(stage); var curMatInv = glmat4.inverse(curMat, []); @@ -118,17 +112,7 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { } this._origin = viewUtils.localToGlobal(eltCtr, stage); - -// if(this.application.ninja.documentController.webTemplate) - if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") - { - this._startOriginArray = []; - this._startOriginArray.push(this._origin.slice()); - } - else - { - this._setTransformOrigin(false); - } + this._setTransformOrigin(false); this.DrawHandles(); } }, -- cgit v1.2.3 From 27935436ad8cd0675311667f70b6a285eb126a94 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 4 May 2012 17:10:01 -0700 Subject: Fixing references to iframe's styles in new template. Signed-off-by: Nivesh Rajbhandari --- js/tools/RotateStage3DTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tools/RotateStage3DTool.js') diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index 90cbe95e..c8818021 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -139,7 +139,7 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { // let the document and stage manager know about the zoom change this.application.ninja.stage._firstDraw = true; this.application.ninja.documentBar.zoomFactor = 100; - this.application.ninja.currentDocument.iframe.style.zoom = 1.0; + this.application.ninja.currentDocument.model.views.design.iframe.style.zoom = 1.0; this.application.ninja.stage._firstDraw = false; // TODO - Any updates to the stage should redraw stage's children. Move this to mediator? -- cgit v1.2.3 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