aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/draw-utils.js
diff options
context:
space:
mode:
authorAnanya Sen2012-06-04 10:43:29 -0700
committerAnanya Sen2012-06-04 10:43:29 -0700
commit6fb29883329c9c42a8b406128b92c0e6323a47be (patch)
tree07f46e88bccf9cdb7d4e6818e1b646b0d19f05b9 /js/helper-classes/3D/draw-utils.js
parentcf097ec69e35c07ecae5a105ed5eeb78291c9ac2 (diff)
parentc1ec69879028220b0c3f11ad6e24035bf527802c (diff)
downloadninja-6fb29883329c9c42a8b406128b92c0e6323a47be.tar.gz
Merge branch 'refs/heads/ninja-internal-master' into cut-copy-paste
Conflicts: js/ninja.reel/ninja.html Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
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]];