aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-05-29 10:26:19 -0700
committerNivesh Rajbhandari2012-05-29 10:26:19 -0700
commit42c2a480a3883389e47d4ec291dfb55d99cf4b7f (patch)
treedbb031822e2409c4bf7d5223dce7c1123b4bc559 /js
parentfa50874d9ca03540dc5741fb51261ef2b56f89ea (diff)
downloadninja-42c2a480a3883389e47d4ec291dfb55d99cf4b7f.tar.gz
Cache perspective distance lookup to speed up user interaction.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/styles-controller.js5
-rwxr-xr-xjs/helper-classes/3D/view-utils.js15
2 files changed, 9 insertions, 11 deletions
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js
index 534f77c7..e76e5a1b 100755
--- a/js/controllers/styles-controller.js
+++ b/js/controllers/styles-controller.js
@@ -1229,9 +1229,10 @@ var stylesController = exports.StylesController = Montage.create(Component, {
1229 } 1229 }
1230 } 1230 }
1231 if(isNaN(dist)) { 1231 if(isNaN(dist)) {
1232 dist = null; 1232 return "none";
1233 } else {
1234 return dist;
1233 } 1235 }
1234 return dist;
1235 } 1236 }
1236 }, 1237 },
1237 1238
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js
index a3d09404..3c7ae6ff 100755
--- a/js/helper-classes/3D/view-utils.js
+++ b/js/helper-classes/3D/view-utils.js
@@ -195,7 +195,12 @@ exports.ViewUtils = Montage.create(Component, {
195 195
196 getPerspectiveDistFromElement: { 196 getPerspectiveDistFromElement: {
197 value: function( elt ) { 197 value: function( elt ) {
198 return ElementsMediator.getPerspectiveDist(elt); 198 var pDist = ElementsMediator.getPerspectiveDist(elt);
199 if(pDist === "none") {
200 return null;
201 } else {
202 return pDist;
203 }
199 } 204 }
200 }, 205 },
201 206
@@ -1320,14 +1325,6 @@ exports.ViewUtils = Montage.create(Component, {
1320 } 1325 }
1321 }, 1326 },
1322 1327
1323 getCurrentDocument:
1324 {
1325 value: function()
1326 {
1327 return snapManagerModule.SnapManager.application.ninja.currentDocument;
1328 }
1329 },
1330
1331 setStageZoom: { 1328 setStageZoom: {
1332 value:function( globalPt, zoomFactor ) { 1329 value:function( globalPt, zoomFactor ) {
1333 var localPt; 1330 var localPt;