From 9d3589feb0174c09d1c1bac405660f8900259c7d Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 22 Feb 2012 04:44:07 -0800 Subject: Adding bug fixes. --- js/helper-classes/3D/snap-manager.js | 1 + js/helper-classes/3D/view-utils.js | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'js/helper-classes/3D') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 0a950658..ada6960b 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -1087,6 +1087,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { // we need to check the orientation of the bounds var nrm = MathUtils.getNormalFromBounds3D( bounds3D ); + if (MathUtils.fpSign(nrm[2]) == 0) return null; var zNrm = nrm[2]; var dist; diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index a2fac34f..bedda8bf 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -1226,6 +1226,14 @@ exports.ViewUtils = Montage.create(Component, { } }, + getCurrentDocument: + { + value: function() + { + return snapManagerModule.SnapManager.application.ninja.currentDocument; + } + }, + setStageZoom: { value:function( globalPt, zoomFactor ) { var localPt; -- cgit v1.2.3 From aaa8d05cc3cfd94322d356e265b94b0abb9f6305 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 23 Feb 2012 01:52:34 -0800 Subject: renaming makeElementModel2 to makeModelFromElement Signed-off-by: Valerio Virgillito --- js/helper-classes/3D/snap-manager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/helper-classes/3D') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 0a950658..2922edf9 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -521,7 +521,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { if (!elt.elementModel) { - NJUtils.makeElementModel2(elt); + NJUtils.makeModelFromElement(elt); } elt.elementModel.isIn2DSnapCache = true; } @@ -588,7 +588,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { if (!elt.elementModel) { - NJUtils.makeElementModel2(elt); + NJUtils.makeModelFromElement(elt); } elt.elementModel.isIn2DSnapCache = true; } -- cgit v1.2.3 From 7283884c39df537694b21419a3ea9e3ca7793b4b Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 23 Feb 2012 13:43:35 -0800 Subject: switch html document - re-initialize draw-utils and snap-manager on opening a document and while switching documents Signed-off-by: Ananya Sen --- js/helper-classes/3D/draw-utils.js | 20 ++++++++++++++++++++ js/helper-classes/3D/snap-manager.js | 1 + 2 files changed, 21 insertions(+) (limited to 'js/helper-classes/3D') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index c07391db..37fc1cfc 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -115,6 +115,26 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { } }, + initializeFromDocument:{ + value:function(){ + var documentRootChildren = null, i; + //initialize with current document + this._eltArray = []; + this._planesArray = []; + this.setDrawingSurfaceElement(this.application.ninja.stage.canvas); + this.setSourceSpaceElement( this.application.ninja.stage.stageDeps.currentStage ); + this.setWorkingPlane( Vector.create( [0,0,1,0] ) ); + + //Loop through all the top-level children of the current document and call drawUtils.addElement on them + if(this.application.ninja.currentDocument.documentRoot.hasChildNodes()){ + documentRootChildren = this.application.ninja.currentDocument.documentRoot.childNodes; + for(i=0;i --- js/helper-classes/3D/LinePlaneIntersectRec.js | 3 --- 1 file changed, 3 deletions(-) (limited to 'js/helper-classes/3D') diff --git a/js/helper-classes/3D/LinePlaneIntersectRec.js b/js/helper-classes/3D/LinePlaneIntersectRec.js index e075dd3d..cb172bf7 100755 --- a/js/helper-classes/3D/LinePlaneIntersectRec.js +++ b/js/helper-classes/3D/LinePlaneIntersectRec.js @@ -42,9 +42,6 @@ var LinePlaneIntersectRec = exports.LinePlaneIntersectRec = Object.create(Object setDeltaVis: { value: function(d) { this._deltaVis = d; } }, getDeltaVis: { value: function() { return this._deltaVis; } }, - getElementPlanes: { value: function() { return this._deltaVis; } }, - setElementPlanes: { value: function(p) { this._elementPlanes = p; } }, - setNext: { value: function(n) { this._next = n; } }, getNext: { value: function() { return this._next; } }, -- cgit v1.2.3 From 2f2472efe0ca55d52fcdf4934bfa52008b68e1de Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 24 Feb 2012 09:40:16 -0800 Subject: Javascript does not evaluate a return with its expression in a new line. The return expression must begin on the same line as the return keyword. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/hit-record.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'js/helper-classes/3D') diff --git a/js/helper-classes/3D/hit-record.js b/js/helper-classes/3D/hit-record.js index 5546cc5a..2c60adc6 100755 --- a/js/helper-classes/3D/hit-record.js +++ b/js/helper-classes/3D/hit-record.js @@ -139,12 +139,10 @@ var HitRecord = exports.HitRecord = Object.create(Object.prototype, isSomeGridTypeSnap : { value: function() { - return - ( - (this._type == this.SNAP_TYPE_GRID_VERTEX) || + return ((this._type == this.SNAP_TYPE_GRID_VERTEX) || (this._type == this.SNAP_TYPE_GRID_HORIZONTAL) || (this._type == this.SNAP_TYPE_GRID_VERTICAL) - ) + ); } }, -- cgit v1.2.3 From b056b4bef5982466d80d72e5cbb31e63087990e1 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 24 Feb 2012 15:30:55 -0800 Subject: - added closeDocument event for timeline - minor bug fixes Signed-off-by: Ananya Sen --- js/helper-classes/3D/draw-utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/helper-classes/3D') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 37fc1cfc..85870097 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -126,8 +126,8 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { this.setWorkingPlane( Vector.create( [0,0,1,0] ) ); //Loop through all the top-level children of the current document and call drawUtils.addElement on them - if(this.application.ninja.currentDocument.documentRoot.hasChildNodes()){ - documentRootChildren = this.application.ninja.currentDocument.documentRoot.childNodes; + if(this.application.ninja.currentDocument._liveNodeList.length > 0){ + documentRootChildren = this.application.ninja.currentDocument._liveNodeList; for(i=0;i