aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/draw-utils.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-05-29 10:35:06 -0700
committerNivesh Rajbhandari2012-05-29 10:35:06 -0700
commit2fd6db5f46208a5aa8fa58d090f795e5b7eb99bb (patch)
tree54846284f7164b3fc84ca454a7075460186e3d09 /js/helper-classes/3D/draw-utils.js
parent42c2a480a3883389e47d4ec291dfb55d99cf4b7f (diff)
downloadninja-2fd6db5f46208a5aa8fa58d090f795e5b7eb99bb.tar.gz
Sped up user-interaction by moving grid drawing into its own canvas so the layout code doesn't have to be run when modifying selected elements.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/helper-classes/3D/draw-utils.js')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index 871b832d..75aa308c 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -126,7 +126,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
126 //initialize with current document 126 //initialize with current document
127 this._eltArray = []; 127 this._eltArray = [];
128 this._planesArray = []; 128 this._planesArray = [];
129 this.setDrawingSurfaceElement(stage.canvas); 129 this.setDrawingSurfaceElement(stage.gridCanvas);
130 this.setSourceSpaceElement( this.application.ninja.currentDocument.model.documentRoot); 130 this.setSourceSpaceElement( this.application.ninja.currentDocument.model.documentRoot);
131 this.setWorkingPlane( [0,0,1,0] ); 131 this.setWorkingPlane( [0,0,1,0] );
132 132
@@ -307,7 +307,6 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
307 } 307 }
308 308
309 if(!changed) { 309 if(!changed) {
310 stage.layout.draw();
311 this.drawWorkingPlane(); 310 this.drawWorkingPlane();
312 this.draw3DCompass(); 311 this.draw3DCompass();
313 } 312 }
@@ -631,8 +630,8 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
631 if (!this.isDrawingGrid()) return; 630 if (!this.isDrawingGrid()) return;
632 631
633 var saveContext = this.getDrawingSurfaceElement(); 632 var saveContext = this.getDrawingSurfaceElement();
634 //this.setDrawingSurfaceElement(window.stageManager.layoutCanvas); 633 this.setDrawingSurfaceElement(this.application.ninja.stage.gridCanvas);
635 this.setDrawingSurfaceElement(this.application.ninja.stage.layoutCanvas); 634 this.clear();
636 635
637 // 3 coordinate axes for the plane 636 // 3 coordinate axes for the plane
638 var zAxis = [this._workingPlane[0], this._workingPlane[1], this._workingPlane[2]]; 637 var zAxis = [this._workingPlane[0], this._workingPlane[1], this._workingPlane[2]];