From c534f70e9af920d252d0d94151c9d6f884283b81 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 1 May 2012 07:01:44 -0700 Subject: Get working plane grid to draw for new stage web template workflow. Signed-off-by: Nivesh Rajbhandari --- js/tools/RotateStage3DTool.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'js/tools') diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index d1701304..0210289f 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -96,6 +96,11 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { viewUtils.pushViewportObj( stage ); var eltCtr = viewUtils.getCenterOfProjection(); viewUtils.popViewportObj(); + if(this.application.ninja.documentController.webTemplate) + { + eltCtr[0] = stage.scrollWidth/2; + eltCtr[1] = stage.scrollHeight/2; + } var curMat = viewUtils.getMatrixFromElement(stage); var curMatInv = glmat4.inverse(curMat, []); @@ -113,8 +118,15 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { this._origin = viewUtils.localToGlobal(eltCtr, stage); - this._setTransformOrigin(false); - + if(this.application.ninja.documentController.webTemplate) + { + this._startOriginArray = []; + this._startOriginArray.push(this._origin.slice()); + } + else + { + this._setTransformOrigin(false); + } this.DrawHandles(); } }, -- cgit v1.2.3 From 84eec0ae4352c9f6e5986529cc70eed726d97a88 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 1 May 2012 09:29:49 -0700 Subject: webTemplate var gets reset to false, so must check for new stage template differently. Signed-off-by: Nivesh Rajbhandari --- js/tools/RotateStage3DTool.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/tools') diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index 0210289f..2a9c63db 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -96,7 +96,8 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { viewUtils.pushViewportObj( stage ); var eltCtr = viewUtils.getCenterOfProjection(); viewUtils.popViewportObj(); - if(this.application.ninja.documentController.webTemplate) +// if(this.application.ninja.documentController.webTemplate) + if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { eltCtr[0] = stage.scrollWidth/2; eltCtr[1] = stage.scrollHeight/2; @@ -118,7 +119,8 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { this._origin = viewUtils.localToGlobal(eltCtr, stage); - if(this.application.ninja.documentController.webTemplate) +// if(this.application.ninja.documentController.webTemplate) + if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { this._startOriginArray = []; this._startOriginArray.push(this._origin.slice()); -- cgit v1.2.3