aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-02-22 11:58:45 -0800
committerNivesh Rajbhandari2012-02-22 11:58:45 -0800
commit75bca514358ed90b8b4274bafed9422c82695776 (patch)
treeb956398809f7bf492a0eedea4993fad8f08a4f89 /js
parent50bb05efbafc9a80f069dfde32988e5cd6826865 (diff)
downloadninja-75bca514358ed90b8b4274bafed9422c82695776.tar.gz
Integrating Zoom tool fixes.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js1
-rwxr-xr-xjs/helper-classes/3D/view-utils.js8
-rwxr-xr-xjs/tools/RotateStage3DTool.js7
-rwxr-xr-xjs/tools/ZoomTool.js2
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, {
1087 1087
1088 // we need to check the orientation of the bounds 1088 // we need to check the orientation of the bounds
1089 var nrm = MathUtils.getNormalFromBounds3D( bounds3D ); 1089 var nrm = MathUtils.getNormalFromBounds3D( bounds3D );
1090 if (MathUtils.fpSign(nrm[2]) == 0) return null;
1090 var zNrm = nrm[2]; 1091 var zNrm = nrm[2];
1091 var dist; 1092 var dist;
1092 1093
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, {
1226 } 1226 }
1227 }, 1227 },
1228 1228
1229 getCurrentDocument:
1230 {
1231 value: function()
1232 {
1233 return snapManagerModule.SnapManager.application.ninja.currentDocument;
1234 }
1235 },
1236
1229 setStageZoom: { 1237 setStageZoom: {
1230 value:function( globalPt, zoomFactor ) { 1238 value:function( globalPt, zoomFactor ) {
1231 var localPt; 1239 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, {
131 var iMat = Matrix.I(4); 131 var iMat = Matrix.I(4);
132 132
133 ElementsMediator.setMatrix(this.application.ninja.currentDocument.documentRoot, iMat, false); 133 ElementsMediator.setMatrix(this.application.ninja.currentDocument.documentRoot, iMat, false);
134
135 this.application.ninja.currentDocument.documentRoot.elementModel.props3D.m_transformCtr = null; 134 this.application.ninja.currentDocument.documentRoot.elementModel.props3D.m_transformCtr = null;
136 135
136 // let the document and stage manager know about the zoom change
137 this.application.ninja.stage._firstDraw = true;
138 this.application.ninja.documentBar.zoomFactor = 100;
139 this.application.ninja.currentDocument.iframe.style.zoom = 1.0;
140 this.application.ninja.stage._firstDraw = false;
141
137 // TODO - Any updates to the stage should redraw stage's children. Move this to mediator? 142 // TODO - Any updates to the stage should redraw stage's children. Move this to mediator?
138 this.application.ninja.stage.updatedStage = true; 143 this.application.ninja.stage.updatedStage = true;
139 144
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, {
146 var dx = Math.abs(point.x - this.downPoint.x), 146 var dx = Math.abs(point.x - this.downPoint.x),
147 dy = Math.abs(point.y - this.downPoint.y); 147 dy = Math.abs(point.y - this.downPoint.y);
148 148
149 if ((dx >= 4) || (dy >= 4)) 149 if ((dx >= 10) || (dy >= 10))
150 { 150 {
151 // Drawing the Marquee 151 // Drawing the Marquee
152 if(this.options.selectedElement==="zoomInTool") 152 if(this.options.selectedElement==="zoomInTool")