aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/draw-utils.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-06-04 11:03:11 -0700
committerJose Antonio Marquez2012-06-04 11:03:11 -0700
commitb6c6c194d4768cf03adee55e8ebe53428cbea2a1 (patch)
treeaaeb5301d1361a1d3a681ebd5c01dd618a712c2e /js/helper-classes/3D/draw-utils.js
parentf02b6c98b193cc4cb7755a098b548efddf15c1bb (diff)
parentc1ec69879028220b0c3f11ad6e24035bf527802c (diff)
downloadninja-b6c6c194d4768cf03adee55e8ebe53428cbea2a1.tar.gz
Merge branch 'refs/heads/Ninja-Internal' into Components
Diffstat (limited to 'js/helper-classes/3D/draw-utils.js')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js21
1 files changed, 5 insertions, 16 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index 871b832d..a793b643 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -112,7 +112,6 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
112 this.eventManager.addEventListener("elementsRemoved", this, false); 112 this.eventManager.addEventListener("elementsRemoved", this, false);
113 this.eventManager.addEventListener("elementChange", this, false); 113 this.eventManager.addEventListener("elementChange", this, false);
114 this.eventManager.addEventListener("elementChanging", this, false); 114 this.eventManager.addEventListener("elementChanging", this, false);
115 this.eventManager.addEventListener("closeDocument", this, false);
116 this.eventManager.addEventListener("elementReplaced", this, false); 115 this.eventManager.addEventListener("elementReplaced", this, false);
117 } 116 }
118 }, 117 },
@@ -126,7 +125,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
126 //initialize with current document 125 //initialize with current document
127 this._eltArray = []; 126 this._eltArray = [];
128 this._planesArray = []; 127 this._planesArray = [];
129 this.setDrawingSurfaceElement(stage.canvas); 128 this.setDrawingSurfaceElement(stage.gridCanvas);
130 this.setSourceSpaceElement( this.application.ninja.currentDocument.model.documentRoot); 129 this.setSourceSpaceElement( this.application.ninja.currentDocument.model.documentRoot);
131 this.setWorkingPlane( [0,0,1,0] ); 130 this.setWorkingPlane( [0,0,1,0] );
132 131
@@ -164,15 +163,6 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
164 } 163 }
165 }, 164 },
166 165
167 handleCloseDocument:{
168 value: function() {
169 if(this.application.ninja.documentController._documents.length === 0){
170 this._eltArray.length = 0;
171 this._planesArray.length = 0;
172 }
173 }
174 },
175
176 handleElementAdded: { 166 handleElementAdded: {
177 value: function(event) { 167 value: function(event) {
178 var elements = event.detail; 168 var elements = event.detail;
@@ -276,8 +266,8 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
276 stage = this.application.ninja.stage, 266 stage = this.application.ninja.stage,
277 minLeft = stage.userPaddingLeft, 267 minLeft = stage.userPaddingLeft,
278 minTop = stage.userPaddingTop, 268 minTop = stage.userPaddingTop,
279 docLeft = stage.documentOffsetLeft, 269 docLeft = stage.userContentLeft,
280 docTop = stage.documentOffsetTop, 270 docTop = stage.userContentTop,
281 l, 271 l,
282 t, 272 t,
283 plane, 273 plane,
@@ -307,7 +297,6 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
307 } 297 }
308 298
309 if(!changed) { 299 if(!changed) {
310 stage.layout.draw();
311 this.drawWorkingPlane(); 300 this.drawWorkingPlane();
312 this.draw3DCompass(); 301 this.draw3DCompass();
313 } 302 }
@@ -628,11 +617,11 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
628 { 617 {
629 value: function () 618 value: function ()
630 { 619 {
620 this.application.ninja.stage.clearGridCanvas();
631 if (!this.isDrawingGrid()) return; 621 if (!this.isDrawingGrid()) return;
632 622
633 var saveContext = this.getDrawingSurfaceElement(); 623 var saveContext = this.getDrawingSurfaceElement();
634 //this.setDrawingSurfaceElement(window.stageManager.layoutCanvas); 624 this.setDrawingSurfaceElement(this.application.ninja.stage.gridCanvas);
635 this.setDrawingSurfaceElement(this.application.ninja.stage.layoutCanvas);
636 625
637 // 3 coordinate axes for the plane 626 // 3 coordinate axes for the plane
638 var zAxis = [this._workingPlane[0], this._workingPlane[1], this._workingPlane[2]]; 627 var zAxis = [this._workingPlane[0], this._workingPlane[1], this._workingPlane[2]];