From 75bca514358ed90b8b4274bafed9422c82695776 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 22 Feb 2012 11:58:45 -0800 Subject: Integrating Zoom tool fixes. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/snap-manager.js | 1 + js/helper-classes/3D/view-utils.js | 8 ++++++++ js/tools/RotateStage3DTool.js | 7 ++++++- js/tools/ZoomTool.js | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 0a950658..ada6960b 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -1087,6 +1087,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { // we need to check the orientation of the bounds var nrm = MathUtils.getNormalFromBounds3D( bounds3D ); + if (MathUtils.fpSign(nrm[2]) == 0) return null; var zNrm = nrm[2]; var dist; diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index a2fac34f..bedda8bf 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -1226,6 +1226,14 @@ exports.ViewUtils = Montage.create(Component, { } }, + getCurrentDocument: + { + value: function() + { + return snapManagerModule.SnapManager.application.ninja.currentDocument; + } + }, + setStageZoom: { value:function( globalPt, zoomFactor ) { var localPt; diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index ca2a8bf3..2b312e53 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -131,9 +131,14 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { var iMat = Matrix.I(4); ElementsMediator.setMatrix(this.application.ninja.currentDocument.documentRoot, iMat, false); - 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; + this.application.ninja.documentBar.zoomFactor = 100; + this.application.ninja.currentDocument.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? this.application.ninja.stage.updatedStage = true; diff --git a/js/tools/ZoomTool.js b/js/tools/ZoomTool.js index 4b6705c1..93caf984 100755 --- a/js/tools/ZoomTool.js +++ b/js/tools/ZoomTool.js @@ -146,7 +146,7 @@ exports.ZoomTool = Montage.create(DrawingTool, { var dx = Math.abs(point.x - this.downPoint.x), dy = Math.abs(point.y - this.downPoint.y); - if ((dx >= 4) || (dy >= 4)) + if ((dx >= 10) || (dy >= 10)) { // Drawing the Marquee if(this.options.selectedElement==="zoomInTool") -- cgit v1.2.3