aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js41
1 files changed, 35 insertions, 6 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index b53ac4ad..b268b8f0 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -245,16 +245,45 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
245 } 245 }
246 var els = event.detail.data.els; 246 var els = event.detail.data.els;
247 if(els && this._shouldUpdatePlanes(event.detail.data.prop)) { 247 if(els && this._shouldUpdatePlanes(event.detail.data.prop)) {
248 var len = els.length; 248 var len = els.length,
249 stage = this.application.ninja.stage,
250 minLeft = stage.userPaddingLeft,
251 minTop = stage.userPaddingTop,
252 docLeft = stage.documentOffsetLeft,
253 docTop = stage.documentOffsetTop,
254 l,
255 t,
256 plane,
257 changed = false;
249 for(var i=0; i < len; i++) { 258 for(var i=0; i < len; i++) {
250 if(els[i].elementModel.props3D.elementPlane) { 259 plane = els[i].elementModel.props3D.elementPlane;
251 els[i].elementModel.props3D.elementPlane.init(); 260 if(plane) {
261 plane.init();
262 l = plane._rect.m_left - docLeft;
263 t = plane._rect.m_top - docTop;
264 if(l < minLeft) {
265 minLeft = l;
266 }
267 if(t < minTop) {
268 minTop = t;
269 }
252 } 270 }
253 } 271 }
254 272
255 this.application.ninja.stage.layout.draw(); 273 if(minLeft !== stage.userPaddingLeft) {
256 this.drawWorkingPlane(); 274 stage.userPaddingLeft = minLeft;
257 this.draw3DCompass(); 275 changed = true;
276 }
277 if(minTop !== stage.userPaddingTop) {
278 stage.userPaddingTop = minTop;
279 changed = true;
280 }
281
282 if(!changed) {
283 stage.layout.draw();
284 this.drawWorkingPlane();
285 this.draw3DCompass();
286 }
258 } 287 }
259 } 288 }
260 }, 289 },