diff options
Diffstat (limited to 'js/helper-classes/3D')
-rwxr-xr-x | js/helper-classes/3D/draw-utils.js | 12 | ||||
-rwxr-xr-x | js/helper-classes/3D/snap-manager.js | 12 | ||||
-rwxr-xr-x | js/helper-classes/3D/view-utils.js | 8 |
3 files changed, 9 insertions, 23 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 88830964..f869f65e 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js | |||
@@ -584,18 +584,10 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { | |||
584 | var ptOnPlane = MathUtils.getPointOnPlane(this._workingPlane); | 584 | var ptOnPlane = MathUtils.getPointOnPlane(this._workingPlane); |
585 | 585 | ||
586 | // define the grid parameters | 586 | // define the grid parameters |
587 | var width, | 587 | var width = this.snapManager.getStageWidth(), |
588 | height, | 588 | height = this.snapManager.getStageHeight(), |
589 | nLines = 10; | 589 | nLines = 10; |
590 | 590 | ||
591 | // if(this.application.ninja.documentController.webTemplate) { | ||
592 | if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { | ||
593 | width = this.application.ninja.currentDocument.documentRoot.scrollWidth; | ||
594 | height = this.application.ninja.currentDocument.documentRoot.scrollHeight; | ||
595 | } else { | ||
596 | width = this.snapManager.getStageWidth(); | ||
597 | height = this.snapManager.getStageHeight(); | ||
598 | } | ||
599 | // get a matrix from working plane space to the world | 591 | // get a matrix from working plane space to the world |
600 | var mat = this.getPlaneToWorldMatrix(zAxis, ptOnPlane); | 592 | var mat = this.getPlaneToWorldMatrix(zAxis, ptOnPlane); |
601 | var tMat = Matrix.Translation( [0.5*width, 0.5*height, 0] ); | 593 | var tMat = Matrix.Translation( [0.5*width, 0.5*height, 0] ); |
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 6766ac7f..5a36e367 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js | |||
@@ -1617,11 +1617,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
1617 | if (x > y) { | 1617 | if (x > y) { |
1618 | if (x > z) { | 1618 | if (x > z) { |
1619 | plane[0] = 1; | 1619 | plane[0] = 1; |
1620 | if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { | 1620 | plane[3] = this.getStageWidth() / 2.0; |
1621 | plane[3] = stage.scrollWidth / 2.0; | ||
1622 | } else { | ||
1623 | plane[3] = this.getStageWidth() / 2.0; | ||
1624 | } | ||
1625 | if (dir[0] > 0) plane[3] = -plane[3]; | 1621 | if (dir[0] > 0) plane[3] = -plane[3]; |
1626 | change = !drawUtils.drawYZ; | 1622 | change = !drawUtils.drawYZ; |
1627 | drawUtils.drawXY = drawUtils.drawXZ = false; | 1623 | drawUtils.drawXY = drawUtils.drawXZ = false; |
@@ -1639,11 +1635,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
1639 | else { | 1635 | else { |
1640 | if (y > z) { | 1636 | if (y > z) { |
1641 | plane[1] = 1; | 1637 | plane[1] = 1; |
1642 | if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { | 1638 | plane[3] = this.getStageHeight() / 2.0; |
1643 | plane[3] = stage.scrollHeight / 2.0; | ||
1644 | } else { | ||
1645 | plane[3] = this.getStageHeight() / 2.0; | ||
1646 | } | ||
1647 | if (dir[1] > 0) plane[3] = -plane[3]; | 1639 | if (dir[1] > 0) plane[3] = -plane[3]; |
1648 | change = !drawUtils.drawXZ; | 1640 | change = !drawUtils.drawXZ; |
1649 | drawUtils.drawXY = drawUtils.drawYZ = false; | 1641 | drawUtils.drawXY = drawUtils.drawYZ = false; |
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 919f7c50..5dc099ee 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js | |||
@@ -355,11 +355,12 @@ exports.ViewUtils = Montage.create(Component, { | |||
355 | // transform the bounds up the tree | 355 | // transform the bounds up the tree |
356 | var child = elt; | 356 | var child = elt; |
357 | var parent = elt.offsetParent; | 357 | var parent = elt.offsetParent; |
358 | while ( parent ) | 358 | while ( child ) |
359 | { | 359 | { |
360 | pt = this.childToParent( pt, child ); | 360 | pt = this.childToParent( pt, child ); |
361 | 361 | ||
362 | if (parent === this._rootElement) break; | 362 | // if (parent === this._rootElement) break; |
363 | if (child === this._stageElement) break; | ||
363 | 364 | ||
364 | child = parent; | 365 | child = parent; |
365 | parent = parent.offsetParent; | 366 | parent = parent.offsetParent; |
@@ -398,7 +399,8 @@ exports.ViewUtils = Montage.create(Component, { | |||
398 | 399 | ||
399 | // transform the bounds up the tree | 400 | // transform the bounds up the tree |
400 | var parent = child.offsetParent; | 401 | var parent = child.offsetParent; |
401 | if ( parent ) | 402 | // TODO - Should have a different way to check for new template mode |
403 | if ( parent || ((child === this.application.ninja.currentDocument.documentRoot) && (child.id !== "UserContent")) ) | ||
402 | { | 404 | { |
403 | this.setViewportObj( child ); | 405 | this.setViewportObj( child ); |
404 | 406 | ||