aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/draw-utils.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-05-24 00:07:23 -0700
committerJose Antonio Marquez2012-05-24 00:07:23 -0700
commit5914c5b2209c4b8daac4249bb76cda5c9314c4e6 (patch)
treef0910e57f64d1638f00bf7f6449d479fb377bfac /js/helper-classes/3D/draw-utils.js
parent16decc5726eafbb25675c61be6df85a378ac1fac (diff)
downloadninja-5914c5b2209c4b8daac4249bb76cda5c9314c4e6.tar.gz
Cleaning up referencing to 'documentRoot' and '_document'
Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view.
Diffstat (limited to 'js/helper-classes/3D/draw-utils.js')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index bf48a723..9de85216 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -124,7 +124,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
124 this._eltArray = []; 124 this._eltArray = [];
125 this._planesArray = []; 125 this._planesArray = [];
126 this.setDrawingSurfaceElement(stage.canvas); 126 this.setDrawingSurfaceElement(stage.canvas);
127 this.setSourceSpaceElement( this.application.ninja.currentDocument.documentRoot); 127 this.setSourceSpaceElement( this.application.ninja.currentDocument.model.documentRoot);
128 this.setWorkingPlane( [0,0,1,0] ); 128 this.setWorkingPlane( [0,0,1,0] );
129 129
130 //Loop through all the top-level children of the current document and call drawUtils.addElement on them 130 //Loop through all the top-level children of the current document and call drawUtils.addElement on them
@@ -697,7 +697,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
697 this._lineColor = saveColor; 697 this._lineColor = saveColor;
698 this._drawingContext.lineWidth = saveLineWidth; 698 this._drawingContext.lineWidth = saveLineWidth;
699 699
700 if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { 700 if(this.application.ninja.currentDocument.model.documentRoot.id !== "UserContent") {
701 // draw an outline around the body 701 // draw an outline around the body
702 var stagePt = MathUtils.getPointOnPlane([0,0,1,0]); 702 var stagePt = MathUtils.getPointOnPlane([0,0,1,0]);
703 var stageMat = this.getPlaneToWorldMatrix([0,0,1], stagePt); 703 var stageMat = this.getPlaneToWorldMatrix([0,0,1], stagePt);
@@ -815,7 +815,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
815 // draw the lines 815 // draw the lines
816 var line, 816 var line,
817 nLines = this._gridLineArray.length; 817 nLines = this._gridLineArray.length;
818 if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { 818 if(this.application.ninja.currentDocument.model.documentRoot.id !== "UserContent") {
819 nLines = this._gridLineArray.length-4; 819 nLines = this._gridLineArray.length-4;
820 } 820 }
821 821
@@ -824,7 +824,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
824 this.drawIntersectedLine(line, this._drawingContext); 824 this.drawIntersectedLine(line, this._drawingContext);
825 } 825 }
826 826
827 if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { 827 if(this.application.ninja.currentDocument.model.documentRoot.id !== "UserContent") {
828 this._lineColor = "red"; 828 this._lineColor = "red";
829 i = nLines; 829 i = nLines;
830 nLines += 4; 830 nLines += 4;
@@ -923,7 +923,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
923 // if all of the planes are aligned, check if they are aligned with the view direction 923 // if all of the planes are aligned, check if they are aligned with the view direction
924 if (flat) 924 if (flat)
925 { 925 {
926 var stage = this.application.ninja.currentDocument.documentRoot; 926 var stage = this.application.ninja.currentDocument.model.documentRoot;
927 var stageMat = this.viewUtils.getMatrixFromElement(stage); 927 var stageMat = this.viewUtils.getMatrixFromElement(stage);
928 var viewDir = [ stageMat[8], stageMat[9], stageMat[10] ]; 928 var viewDir = [ stageMat[8], stageMat[9], stageMat[10] ];
929 viewDir = vecUtils.vecNormalize( 3, viewDir ); 929 viewDir = vecUtils.vecNormalize( 3, viewDir );
@@ -1213,7 +1213,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
1213 value: function() { 1213 value: function() {
1214 // set the element to be the viewport object - temporarily 1214 // set the element to be the viewport object - temporarily
1215 var tmpCanvas = this.application.ninja.stage.canvas; 1215 var tmpCanvas = this.application.ninja.stage.canvas;
1216 var tmpStage = this.application.ninja.currentDocument.documentRoot; 1216 var tmpStage = this.application.ninja.currentDocument.model.documentRoot;
1217 this.viewUtils.pushViewportObj( tmpCanvas ); 1217 this.viewUtils.pushViewportObj( tmpCanvas );
1218 1218
1219 // save the source space object and set to the target object 1219 // save the source space object and set to the target object