aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/draw-utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/3D/draw-utils.js')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index bf48a723..79be5c14 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -119,7 +119,10 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
119 119
120 initializeFromDocument:{ 120 initializeFromDocument:{
121 value:function(){ 121 value:function(){
122 var documentRootChildren = null, i, stage = this.application.ninja.stage; 122 var i,
123 documentRootChildren = this.application.ninja.currentDocument.model.views.design.getLiveNodeList(true),
124 stage = this.application.ninja.stage,
125 len = documentRootChildren.length;
123 //initialize with current document 126 //initialize with current document
124 this._eltArray = []; 127 this._eltArray = [];
125 this._planesArray = []; 128 this._planesArray = [];
@@ -128,11 +131,11 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
128 this.setWorkingPlane( [0,0,1,0] ); 131 this.setWorkingPlane( [0,0,1,0] );
129 132
130 //Loop through all the top-level children of the current document and call drawUtils.addElement on them 133 //Loop through all the top-level children of the current document and call drawUtils.addElement on them
131 if(this.application.ninja.currentDocument._liveNodeList.length > 0){ 134 if(len > 0) {
132 documentRootChildren = this.application.ninja.currentDocument._liveNodeList; 135 var initL = 0,
133 var len = documentRootChildren.length, 136 initT = 0,
134 minLeft = stage.userPaddingLeft, 137 minLeft = 0,
135 minTop = stage.userPaddingTop, 138 minTop = 0,
136 docLeft = stage.documentOffsetLeft, 139 docLeft = stage.documentOffsetLeft,
137 docTop = stage.documentOffsetTop, 140 docTop = stage.documentOffsetTop,
138 l, 141 l,
@@ -151,10 +154,10 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
151 minTop = t; 154 minTop = t;
152 } 155 }
153 } 156 }
154 if(minLeft !== stage.userPaddingLeft) { 157 if(minLeft !== initL) {
155 stage.userPaddingLeft = minLeft; 158 stage.userPaddingLeft = minLeft;
156 } 159 }
157 if(minTop !== stage.userPaddingTop) { 160 if(minTop !== initT) {
158 stage.userPaddingTop = minTop; 161 stage.userPaddingTop = minTop;
159 } 162 }
160 } 163 }