From 529463fad4cf0a13293187b47e6b5081f3446cad Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 8 Feb 2012 15:13:25 -0800 Subject: Merging snap manager fix for infinite projection errors when stage view is changed to top or side. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/snap-manager.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'js/helper-classes/3D/snap-manager.js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 3af7d8cf..0a950658 100644 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -970,13 +970,12 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { value: function( screenPt, hitRecs ) { // start at the stage. var stage = this.getStage(); - //var stagePt = viewUtils.parentToChild( screenPt, stage ); // the root should be the 'view' canvas, so the first matrix is the camera viewUtils.setViewportObj( stage ); MathUtils.makeDimension3( screenPt ); - this.hSnapToElements( stage, screenPt, hitRecs, 0, screenPt ); + this.hSnapToElements( stage, hitRecs, 0, screenPt ); return; } @@ -984,7 +983,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { hSnapToElements : { - value: function( elt, parentPt, hitRecs, depth, globalScrPt ) + value: function( elt, hitRecs, depth, globalScrPt ) { // hit test the current object var hit; @@ -993,11 +992,9 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { // if the element is in the 2D cache snapping is done there if (elt.elementModel && !elt.elementModel.isIn2DSnapCache) { - var scrPt = viewUtils.parentToChild( parentPt, elt, false ); - hit = this.snapToElement( elt, scrPt, globalScrPt ); + hit = this.snapToElement( elt, globalScrPt ); if (hit) { - //hitRecs.push( hit ); if (!hit.checkType()) { console.log( "invalid hit record: " + hit.getTypeString() ); @@ -1016,17 +1013,14 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { } // test the rest of the tree var n = elt.childElementCount; - var eltPt = viewUtils.parentToChild( parentPt, elt, true ); if (n > 0) { for (var i=0; i