From 8f8f7f9a36fb9abadea2a9f25aef0084946bebc9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 4 May 2012 14:42:00 -0700 Subject: Removed special-casing for new template workflow. Instead, we will enforce a width and height on the body in order to do 3d. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/view-utils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 40a19b90..36d6f8c4 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -309,11 +309,12 @@ exports.ViewUtils = Montage.create(Component, { // transform the bounds up the tree var child = elt; var parent = elt.offsetParent; - while ( parent ) + while ( child ) { pt = this.childToParent( pt, child ); - if (parent === this._rootElement) break; +// if (parent === this._rootElement) break; + if (child === this._stageElement) break; child = parent; parent = parent.offsetParent; @@ -352,7 +353,8 @@ exports.ViewUtils = Montage.create(Component, { // transform the bounds up the tree var parent = child.offsetParent; - if ( parent ) + // TODO - Should have a different way to check for new template mode + if ( parent || ((child === this.application.ninja.currentDocument.documentRoot) && (child.id !== "UserContent")) ) { this.setViewportObj( child ); -- cgit v1.2.3 From 9eeb03e8bb86a4462609d3a18b528daa1516b91c Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 7 May 2012 13:57:18 -0700 Subject: fixes for 2D and 3D translation. --- js/helper-classes/3D/view-utils.js | 80 ++++++++++++++++++++++++++++++-------- 1 file changed, 63 insertions(+), 17 deletions(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 40a19b90..919f7c50 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -124,35 +124,81 @@ exports.ViewUtils = Montage.create(Component, { } }, - getNormalToUnprojectedElementPlane: { - value: function( elt ) { - var mat = this.getMatrixFromElement(elt); + /* + * This method will return a normal to a plane containing the Z axis and either the + * x or y axis of the element. + */ + getNormalToUnprojectedElementPlane: + { + value: function( elt, axis, localMode ) + { + var objMat = this.getMatrixFromElement(elt); + var objMatInv = glmat4.inverse( objMat, [] ); - var xVec = [mat[0], mat[1], mat[2], mat[3]]; - var yVec = [mat[4], mat[5], mat[6], mat[7]]; + var xVec = [1,0,0]; + var yVec = [0,1,0]; + var zVec = [0,0,1]; var stage = this.application.ninja.currentDocument.documentRoot; var stageMat = this.getMatrixFromElement(stage); - var stagePlane = [stageMat[8], stageMat[9], stageMat[10], stageMat[11]]; + var mat = glmat4.multiply( stageMat, objMat, [] ); + + var viewDir; + if (localMode) + { + var matInv = glmat4.inverse( mat, [] ); + viewDir = MathUtils.transformVector( [0,0,1], matInv ); + } + else + { + var stageInv = glmat4.inverse( stageMat, [] ); + viewDir = MathUtils.transformVector( [0,0,1], stageInv ); + } + + /* if (elt === stage) { xVec = [1,0,0]; yVec = [0,1,0]; } + */ - var xDot = Math.abs(vecUtils.vecDot(3, xVec, stagePlane)); - var yDot = Math.abs(vecUtils.vecDot(3, yVec, stagePlane)); + var plane; + var xDot, yDot, zDot; + switch (axis) + { + case 0: + yDot = Math.abs(vecUtils.vecDot(3, yVec, viewDir)); + zDot = Math.abs(vecUtils.vecDot(3, zVec, viewDir)); + if(yDot > zDot) + plane = vecUtils.vecCross( 3, zVec, xVec ); + else + plane = vecUtils.vecCross( 3, yVec, xVec ); + break; + + case 1: + xDot = Math.abs(vecUtils.vecDot(3, yVec, viewDir)); + zDot = Math.abs(vecUtils.vecDot(3, zVec, viewDir)); + if(xDot > zDot) + plane = vecUtils.vecCross( 3, zVec, yVec ); + else + plane = vecUtils.vecCross( 3, xVec, yVec ); + break; + break; + + case 2: + xDot = Math.abs(vecUtils.vecDot(3, xVec, viewDir)); + yDot = Math.abs(vecUtils.vecDot(3, yVec, viewDir)); + + if(xDot > yDot) + plane = vecUtils.vecCross( 3, yVec, zVec ); + else + plane = vecUtils.vecCross( 3, xVec, zVec ); + break; + } - var plane; - if(xDot > yDot) - { - plane = xVec; - } - else - { - plane = yVec; - } + if (localMode) plane = MathUtils.transformVector( plane, objMat ); // The translation value is a point on the plane this.pushViewportObj( elt ); -- cgit v1.2.3 From babfa5f1ca4f702920d81d7e12a90b12ffbf42d8 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 10 May 2012 16:53:18 -0700 Subject: Fixed an inaccuracy snapping to the stage. --- js/helper-classes/3D/view-utils.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 919f7c50..48d4cacf 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -288,6 +288,11 @@ exports.ViewUtils = Montage.create(Component, { value: function( localPt, elt ) { this.pushViewportObj( elt ); var viewPt = this.screenToView( localPt[0], localPt[1], localPt[2] ); + if ((elt == null) || (elt === this._stageElement)) + { + this.popViewportObj(); + return viewPt; + } var mat = this.getMatrixFromElement( elt ); var worldPt = MathUtils.transformPoint( viewPt, mat ); var stageWorldPt = this.postViewToStageWorld( worldPt, elt ); -- cgit v1.2.3 From 6abfeed78ddae26f04531cddbcb560451891c412 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 11 May 2012 10:59:59 -0700 Subject: Checked/Unchecked 'Use WebGL' checkbox in PI throws error in view-utils.. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/view-utils.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 5dc099ee..6da6de0e 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -359,11 +359,9 @@ exports.ViewUtils = Montage.create(Component, { { pt = this.childToParent( pt, child ); -// if (parent === this._rootElement) break; if (child === this._stageElement) break; child = parent; - parent = parent.offsetParent; } ///////////////////////////////////////////////////////// -- cgit v1.2.3 From 0fc470ad85e435ff6e66f05d9de1cad2b2ff91c8 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 11 May 2012 13:31:23 -0700 Subject: Fixing drawing in nested divs. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/view-utils.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 6da6de0e..22446403 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -354,14 +354,13 @@ exports.ViewUtils = Montage.create(Component, { // transform the bounds up the tree var child = elt; - var parent = elt.offsetParent; while ( child ) { pt = this.childToParent( pt, child ); if (child === this._stageElement) break; - child = parent; + child = child.offsetParent; } ///////////////////////////////////////////////////////// -- cgit v1.2.3 From 734b6ad96d25bb67d0db4a0a75c331468e194809 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 14 May 2012 12:05:41 -0700 Subject: Fixing 3d to work in banner templates. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/view-utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 22446403..8c338f84 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -358,9 +358,13 @@ exports.ViewUtils = Montage.create(Component, { { pt = this.childToParent( pt, child ); - if (child === this._stageElement) break; +// if (child === this._stageElement) break; +// child = child.offsetParent; + if (child === this._stageElement) break; + if (child === this._rootElement) break; child = child.offsetParent; + if (child === this._rootElement) break; } ///////////////////////////////////////////////////////// -- cgit v1.2.3 From 904c7bfb65bb04400a0f63af1156cd9341958935 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 14 May 2012 15:11:22 -0700 Subject: Drag plane not being set. Injection from a recent checkin of mine. --- js/helper-classes/3D/view-utils.js | 8 -------- 1 file changed, 8 deletions(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 48d4cacf..00124900 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -156,14 +156,6 @@ exports.ViewUtils = Montage.create(Component, { viewDir = MathUtils.transformVector( [0,0,1], stageInv ); } - /* - if (elt === stage) - { - xVec = [1,0,0]; - yVec = [0,1,0]; - } - */ - var plane; var xDot, yDot, zDot; switch (axis) -- cgit v1.2.3 From b72c5f72ea5df4aa164350e1ba66fd1b4e23369d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 17 May 2012 23:07:48 -0700 Subject: removing all stageDeps for drawing classes. Signed-off-by: Valerio Virgillito --- js/helper-classes/3D/view-utils.js | 53 ++++++++++++++------------------------ 1 file changed, 20 insertions(+), 33 deletions(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 8c338f84..20f61be1 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -18,18 +18,14 @@ exports.ViewUtils = Montage.create(Component, { // Instance variables /////////////////////////////////////////////////////////////////////// - m_viewportObj : { value: null, writable: true}, - _perspectiveDist: { value: null, writable: true}, + m_viewportObj : { value: null}, + _perspectiveDist: { value: null}, // keep a stack of viewport objects - _viewportObjStack: { value: [], writable: true }, + _viewportObjStack: { value: []}, - _currentDocument: { value: null , writable: true}, - _userContentLeft: { value: null , writable: true}, - _userContentTop: { value: null , writable: true}, - - _rootElement: { value: null, writable: true}, - _stageElement: { value: null, writable: true}, + _userContentLeft: { value: null}, + _userContentTop: { value: null}, /////////////////////////////////////////////////////////////////////// // Property accessors @@ -43,18 +39,9 @@ exports.ViewUtils = Montage.create(Component, { }, getViewportObj: { value: function() { return this.m_viewportObj; } }, - setRootElement: { value: function( elt ) { this._rootElement = elt; } }, - getRootElement: { value: function () { return this._rootElement; } }, - - setStageElement: { value: function( elt ) { this._stageElement = elt; } }, - getStageElement: { value: function () { return this._stageElement; } }, - - setCurrentDocument: { value: function(value) { this._currentDocument = value; }}, - setUserContentLeft: { value: function(value) { this._userContentLeft = value; }}, setUserContentTop: { value: function(value) { this._userContentTop = value; }}, - getPerspectiveDistance: { value: function () { return this._perspectiveDist; } }, /////////////////////////////////////////////////////////////////////// @@ -302,7 +289,7 @@ exports.ViewUtils = Montage.create(Component, { // into stage world space. postViewToStageWorld: { value: function( localPt, elt ) { - if ((elt == null) || (elt === this._stageElement)) return localPt; + if ((elt == null) || (elt === this.application.ninja.currentDocument.documentRoot)) return localPt; // get the 3D transformation and 2D offset from the element var pt = localPt.slice(0); @@ -329,7 +316,7 @@ exports.ViewUtils = Montage.create(Component, { this.popViewportObj(); // check if we are done - if (parent === this._stageElement) break; + if (parent === this.application.ninja.currentDocument.documentRoot) break; if (this.elementHas3D( parent )) { @@ -358,13 +345,13 @@ exports.ViewUtils = Montage.create(Component, { { pt = this.childToParent( pt, child ); -// if (child === this._stageElement) break; +// if (child === this.application.ninja.currentDocument.documentRoot) break; // child = child.offsetParent; - if (child === this._stageElement) break; - if (child === this._rootElement) break; + if (child === this.application.ninja.currentDocument.documentRoot) break; + if (child === this.application.ninja.currentDocument.documentRoot.parentNode) break; child = child.offsetParent; - if (child === this._rootElement) break; + if (child === this.application.ninja.currentDocument.documentRoot.parentNode) break; } ///////////////////////////////////////////////////////// @@ -414,7 +401,7 @@ exports.ViewUtils = Montage.create(Component, { { // TODO - Commenting out flatten support until new perspective workflow is fully working // if (flatten) pt[2] = 0; -// var flatten = (parent !== this._rootElement) && (ElementsMediator.getProperty(parent, "-webkit-transform-style") !== "preserve-3d"); +// var flatten = (parent !== this.application.ninja.currentDocument.documentRoot.parentNode) && (ElementsMediator.getProperty(parent, "-webkit-transform-style") !== "preserve-3d"); // if(flatten) // { // pt[2] = 0; @@ -699,7 +686,7 @@ exports.ViewUtils = Montage.create(Component, { // if (elt.__ninjaXOff) xOff = elt.__ninjaXOff; // if (elt.__ninjaYOff) yOff = elt.__ninjaYOff; var offset = [xOff, yOff]; - if(elt.offsetParent && (elt.offsetParent !== this._stageElement)) + if(elt.offsetParent && (elt.offsetParent !== this.application.ninja.currentDocument.documentRoot)) { var pS = elt.ownerDocument.defaultView.getComputedStyle(elt.offsetParent); @@ -715,7 +702,7 @@ exports.ViewUtils = Montage.create(Component, { } } - if(elt === this._stageElement) + if(elt === this.application.ninja.currentDocument.documentRoot) { // TODO - Call a routine from the user document controller to get the offsets/margins // Once we expose the document controller to ViewUtils @@ -1006,7 +993,7 @@ exports.ViewUtils = Montage.create(Component, { glmat4.multiply( v2s, mat, mat ); // TODO - Commenting out flatten support until new perspective workflow is fully working -// var flatten = (elt !== this._rootElement) && (elt.parentElement !== this._rootElement) && (ElementsMediator.getProperty(elt.parentElement, "-webkit-transform-style") !== "preserve-3d"); +// var flatten = (elt !== this.application.ninja.currentDocument.documentRoot.parentNode) && (elt.parentElement !== this.application.ninja.currentDocument.documentRoot.parentNode) && (ElementsMediator.getProperty(elt.parentElement, "-webkit-transform-style") !== "preserve-3d"); // if(flatten) // { // glmat4.multiply( zMat, mat, mat ); @@ -1020,10 +1007,10 @@ exports.ViewUtils = Montage.create(Component, { this.popViewportObj(); - if (elt === this._stageElement) break; - if (elt === this._rootElement) break; + if (elt === this.application.ninja.currentDocument.documentRoot) break; + if (elt === this.application.ninja.currentDocument.documentRoot.parentNode) break; elt = elt.offsetParent; - if (elt === this._rootElement) break; + if (elt === this.application.ninja.currentDocument.documentRoot.parentNode) break; } return mat; @@ -1057,7 +1044,7 @@ exports.ViewUtils = Montage.create(Component, { // multiply all the matrices together //mat = s2v.multiply( mat ); glmat4.multiply( s2v, mat, mat ); - if (elt === this._stageElement) break; + if (elt === this.application.ninja.currentDocument.documentRoot) break; //mat = objMat.multiply( mat ); glmat4.multiply( objMat, mat, mat ); if(shouldProject && pDist) @@ -1106,7 +1093,7 @@ exports.ViewUtils = Montage.create(Component, { // multiply all the matrices together //mat = s2v.multiply( mat ); glmat4.multiply( s2v, mat, mat ); - if (elt === this._stageElement) break; + if (elt === this.application.ninja.currentDocument.documentRoot) break; //mat = objMat.multiply( mat ); if (shouldLocalTransform) { glmat4.multiply( objMat, mat, mat ); -- cgit v1.2.3 From 66edf78c7e5df11218ef733686965beab05c7c7d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 14:01:00 -0700 Subject: fixing a scrolling issue when multiple documents are switched Signed-off-by: Valerio Virgillito --- js/helper-classes/3D/view-utils.js | 9 --------- 1 file changed, 9 deletions(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 20f61be1..75530af3 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -1303,15 +1303,6 @@ exports.ViewUtils = Montage.create(Component, { // MISCELLANEOUS // event.layerX/Y: var pt = viewUtils.getMousePoint(event); - getStageDimension: { - value: function() - { - var width = parseInt(this.application.ninja.stage.documentRoot.elementModel.stageDimension.style.getProperty("width")); - var height= parseInt(this.application.ninja.stage.documentRoot.elementModel.stageDimension.style.getProperty("height")); - return[width,height]; - } - }, - getStage: { value: function() { -- cgit v1.2.3 From f97590388467b5a3316f6f155162fc293915fddc Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 23 May 2012 16:09:22 -0700 Subject: Fixed scrolling and centering stage code. Also, moved liveNodeList into the design view and added an option to exclude styles and text nodes when retrieving the live nodes. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/view-utils.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 0080bf90..24b30298 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -24,9 +24,6 @@ exports.ViewUtils = Montage.create(Component, { // keep a stack of viewport objects _viewportObjStack: { value: []}, - _userContentLeft: { value: null}, - _userContentTop: { value: null}, - /////////////////////////////////////////////////////////////////////// // Property accessors /////////////////////////////////////////////////////////////////////// @@ -39,9 +36,6 @@ exports.ViewUtils = Montage.create(Component, { }, getViewportObj: { value: function() { return this.m_viewportObj; } }, - setUserContentLeft: { value: function(value) { this._userContentLeft = value; }}, - setUserContentTop: { value: function(value) { this._userContentTop = value; }}, - getPerspectiveDistance: { value: function () { return this._perspectiveDist; } }, /////////////////////////////////////////////////////////////////////// @@ -385,7 +379,7 @@ exports.ViewUtils = Montage.create(Component, { // transform the bounds up the tree var parent = child.offsetParent; // TODO - Should have a different way to check for new template mode - if ( parent || ((child === this.application.ninja.currentDocument.documentRoot) && (child.id !== "UserContent")) ) + if ( parent || (child === this.application.ninja.currentDocument.documentRoot) ) { this.setViewportObj( child ); @@ -703,8 +697,8 @@ exports.ViewUtils = Montage.create(Component, { { // TODO - Call a routine from the user document controller to get the offsets/margins // Once we expose the document controller to ViewUtils - offset[0] += this._userContentLeft; - offset[1] += this._userContentTop; + offset[0] += this.application.ninja.stage._userContentLeft; + offset[1] += this.application.ninja.stage._userContentTop; } return offset; @@ -1282,7 +1276,6 @@ exports.ViewUtils = Montage.create(Component, { // stageManager._canvas: this.application.ninja.stage.canvas // stageManager.layoutCanvas: this.application.ninja.stage.layoutCanvas // stageManager.drawingCanvas: this.application.ninja.stage.drawingCanvas -// stageManager.userContentLeft this.application.ninja.stage.userContentLeft // viewUtils: stage.viewUtils; // snapManager stage.snapManager; // -- cgit v1.2.3 From 5914c5b2209c4b8daac4249bb76cda5c9314c4e6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 24 May 2012 00:07:23 -0700 Subject: 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. --- js/helper-classes/3D/view-utils.js | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'js/helper-classes/3D/view-utils.js') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 0080bf90..f5ab7172 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -126,7 +126,7 @@ exports.ViewUtils = Montage.create(Component, { var yVec = [0,1,0]; var zVec = [0,0,1]; - var stage = this.application.ninja.currentDocument.documentRoot; + var stage = this.application.ninja.currentDocument.model.documentRoot; var stageMat = this.getMatrixFromElement(stage); var mat = glmat4.multiply( stageMat, objMat, [] ); @@ -286,7 +286,7 @@ exports.ViewUtils = Montage.create(Component, { // into stage world space. postViewToStageWorld: { value: function( localPt, elt ) { - if ((elt == null) || (elt === this.application.ninja.currentDocument.documentRoot)) return localPt; + if ((elt == null) || (elt === this.application.ninja.currentDocument.model.documentRoot)) return localPt; // get the 3D transformation and 2D offset from the element var pt = localPt.slice(0); @@ -313,7 +313,7 @@ exports.ViewUtils = Montage.create(Component, { this.popViewportObj(); // check if we are done - if (parent === this.application.ninja.currentDocument.documentRoot) break; + if (parent === this.application.ninja.currentDocument.model.documentRoot) break; if (this.elementHas3D( parent )) { @@ -342,13 +342,13 @@ exports.ViewUtils = Montage.create(Component, { { pt = this.childToParent( pt, child ); -// if (child === this.application.ninja.currentDocument.documentRoot) break; +// if (child === this.application.ninja.currentDocument.model.documentRoot) break; // child = child.offsetParent; - if (child === this.application.ninja.currentDocument.documentRoot) break; - if (child === this.application.ninja.currentDocument.documentRoot.parentNode) break; + if (child === this.application.ninja.currentDocument.model.documentRoot) break; + if (child === this.application.ninja.currentDocument.model.documentRoot.parentNode) break; child = child.offsetParent; - if (child === this.application.ninja.currentDocument.documentRoot.parentNode) break; + if (child === this.application.ninja.currentDocument.model.documentRoot.parentNode) break; } ///////////////////////////////////////////////////////// @@ -385,7 +385,7 @@ exports.ViewUtils = Montage.create(Component, { // transform the bounds up the tree var parent = child.offsetParent; // TODO - Should have a different way to check for new template mode - if ( parent || ((child === this.application.ninja.currentDocument.documentRoot) && (child.id !== "UserContent")) ) + if ( parent || ((child === this.application.ninja.currentDocument.model.documentRoot) && (child.id !== "UserContent")) ) { this.setViewportObj( child ); @@ -398,7 +398,7 @@ exports.ViewUtils = Montage.create(Component, { { // TODO - Commenting out flatten support until new perspective workflow is fully working // if (flatten) pt[2] = 0; -// var flatten = (parent !== this.application.ninja.currentDocument.documentRoot.parentNode) && (ElementsMediator.getProperty(parent, "-webkit-transform-style") !== "preserve-3d"); +// var flatten = (parent !== this.application.ninja.currentDocument.model.documentRoot.parentNode) && (ElementsMediator.getProperty(parent, "-webkit-transform-style") !== "preserve-3d"); // if(flatten) // { // pt[2] = 0; @@ -458,7 +458,7 @@ exports.ViewUtils = Montage.create(Component, { // get the four corners of the element in global space var bounds = this.getElementViewBounds3D( elt ); var bounds3D = new Array(); - var stage = this.application.ninja.currentDocument.documentRoot; + var stage = this.application.ninja.currentDocument.model.documentRoot; for (var i=0; i<3; i++) { var gPt = this.localToGlobal( bounds[i], elt ); @@ -683,7 +683,7 @@ exports.ViewUtils = Montage.create(Component, { // if (elt.__ninjaXOff) xOff = elt.__ninjaXOff; // if (elt.__ninjaYOff) yOff = elt.__ninjaYOff; var offset = [xOff, yOff]; - if(elt.offsetParent && (elt.offsetParent !== this.application.ninja.currentDocument.documentRoot)) + if(elt.offsetParent && (elt.offsetParent !== this.application.ninja.currentDocument.model.documentRoot)) { var pS = elt.ownerDocument.defaultView.getComputedStyle(elt.offsetParent); @@ -699,7 +699,7 @@ exports.ViewUtils = Montage.create(Component, { } } - if(elt === this.application.ninja.currentDocument.documentRoot) + if(elt === this.application.ninja.currentDocument.model.documentRoot) { // TODO - Call a routine from the user document controller to get the offsets/margins // Once we expose the document controller to ViewUtils @@ -876,7 +876,7 @@ exports.ViewUtils = Montage.create(Component, { { value: function() { - var stage = this.application.ninja.currentDocument.documentRoot; + var stage = this.application.ninja.currentDocument.model.documentRoot; this.pushViewportObj( stage ); // put the point into screen space of the stage - requires @@ -990,7 +990,7 @@ exports.ViewUtils = Montage.create(Component, { glmat4.multiply( v2s, mat, mat ); // TODO - Commenting out flatten support until new perspective workflow is fully working -// var flatten = (elt !== this.application.ninja.currentDocument.documentRoot.parentNode) && (elt.parentElement !== this.application.ninja.currentDocument.documentRoot.parentNode) && (ElementsMediator.getProperty(elt.parentElement, "-webkit-transform-style") !== "preserve-3d"); +// var flatten = (elt !== this.application.ninja.currentDocument.model.documentRoot.parentNode) && (elt.parentElement !== this.application.ninja.currentDocument.model.documentRoot.parentNode) && (ElementsMediator.getProperty(elt.parentElement, "-webkit-transform-style") !== "preserve-3d"); // if(flatten) // { // glmat4.multiply( zMat, mat, mat ); @@ -1004,10 +1004,10 @@ exports.ViewUtils = Montage.create(Component, { this.popViewportObj(); - if (elt === this.application.ninja.currentDocument.documentRoot) break; - if (elt === this.application.ninja.currentDocument.documentRoot.parentNode) break; + if (elt === this.application.ninja.currentDocument.model.documentRoot) break; + if (elt === this.application.ninja.currentDocument.model.documentRoot.parentNode) break; elt = elt.offsetParent; - if (elt === this.application.ninja.currentDocument.documentRoot.parentNode) break; + if (elt === this.application.ninja.currentDocument.model.documentRoot.parentNode) break; } return mat; @@ -1041,7 +1041,7 @@ exports.ViewUtils = Montage.create(Component, { // multiply all the matrices together //mat = s2v.multiply( mat ); glmat4.multiply( s2v, mat, mat ); - if (elt === this.application.ninja.currentDocument.documentRoot) break; + if (elt === this.application.ninja.currentDocument.model.documentRoot) break; //mat = objMat.multiply( mat ); glmat4.multiply( objMat, mat, mat ); if(shouldProject && pDist) @@ -1090,7 +1090,7 @@ exports.ViewUtils = Montage.create(Component, { // multiply all the matrices together //mat = s2v.multiply( mat ); glmat4.multiply( s2v, mat, mat ); - if (elt === this.application.ninja.currentDocument.documentRoot) break; + if (elt === this.application.ninja.currentDocument.model.documentRoot) break; //mat = objMat.multiply( mat ); if (shouldLocalTransform) { glmat4.multiply( objMat, mat, mat ); @@ -1277,7 +1277,7 @@ exports.ViewUtils = Montage.create(Component, { // // STAGE ACCESSORS: // activeDocument: this.application.ninja.currentDocument -// userContent (stage): this.application.ninja.currentDocument.documentRoot +// userContent (stage): this.application.ninja.currentDocument.model.documentRoot // stageManager: this.application.ninja.stage // MainApp\js\stage\stage.reel\stage.js // stageManager._canvas: this.application.ninja.stage.canvas // stageManager.layoutCanvas: this.application.ninja.stage.layoutCanvas @@ -1312,7 +1312,7 @@ exports.ViewUtils = Montage.create(Component, { if (this.application.ninja.currentDocument) { // get the user content object - var userContent = this.application.ninja.currentDocument.documentRoot; + var userContent = this.application.ninja.currentDocument.model.documentRoot; if (!userContent) return; this.setViewportObj( userContent ); @@ -1342,7 +1342,7 @@ exports.ViewUtils = Montage.create(Component, { if (this.application.ninja.currentDocument) { - var userContent = this.application.ninja.currentDocument.documentRoot; + var userContent = this.application.ninja.currentDocument.model.documentRoot; if (!userContent) return; this.setViewportObj( userContent ); var userContentMat = this.getMatrixFromElement(userContent); -- cgit v1.2.3