aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/snap-manager.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-12 16:00:44 -0700
committerValerio Virgillito2012-04-12 16:00:44 -0700
commit4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (patch)
tree18a1f0e3679c0eb993a9dedb537035d3861f49ac /js/helper-classes/3D/snap-manager.js
parent9d1c919a4865ab1a2b0b0b9fc893a54b145c82c0 (diff)
parent77c6ab76ffe9fc380ed6fdb7b29ccd40acaee74d (diff)
downloadninja-4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9.tar.gz
Merge pull request #162 from mqg734/BoundsCalculation
offsets should be calculated on offsetParent instead of parentElement.
Diffstat (limited to 'js/helper-classes/3D/snap-manager.js')
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index 61f5bc97..02e81a62 100755
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -1354,7 +1354,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1354 var offset = viewUtils.getElementOffset( elt ); 1354 var offset = viewUtils.getElementOffset( elt );
1355 MathUtils.makeDimension3( offset ); 1355 MathUtils.makeDimension3( offset );
1356 var parentPt = vecUtils.vecAdd(3, scrPt, offset ); 1356 var parentPt = vecUtils.vecAdd(3, scrPt, offset );
1357 var globalPt = viewUtils.localToGlobal( parentPt, elt.parentElement ); 1357 var globalPt = viewUtils.localToGlobal( parentPt, elt.offsetParent );
1358 1358
1359 var dist = vecUtils.vecDist(2, globalPt, targetScrPt ); 1359 var dist = vecUtils.vecDist(2, globalPt, targetScrPt );
1360 if (dist < this.ELEMENT_VERTEX_HIT_RAD) 1360 if (dist < this.ELEMENT_VERTEX_HIT_RAD)
@@ -1392,7 +1392,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1392 var offset = viewUtils.getElementOffset( elt ); 1392 var offset = viewUtils.getElementOffset( elt );
1393 MathUtils.makeDimension3( offset ); 1393 MathUtils.makeDimension3( offset );
1394 var parentPt = vecUtils.vecAdd(3, scrPt, offset ); 1394 var parentPt = vecUtils.vecAdd(3, scrPt, offset );
1395 var globalPt = viewUtils.localToGlobal( parentPt, elt.parentElement ); 1395 var globalPt = viewUtils.localToGlobal( parentPt, elt.offsetParent );
1396 1396
1397 var dist = vecUtils.vecDist(2, globalPt, targetScrPt ); 1397 var dist = vecUtils.vecDist(2, globalPt, targetScrPt );
1398 if (dist < this.ELEMENT_EDGE_HIT_RAD) 1398 if (dist < this.ELEMENT_EDGE_HIT_RAD)
@@ -1445,7 +1445,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1445 var offset = viewUtils.getElementOffset( elt ); 1445 var offset = viewUtils.getElementOffset( elt );
1446 MathUtils.makeDimension3( offset ); 1446 MathUtils.makeDimension3( offset );
1447 var parentPt = vecUtils.vecAdd(3, scrPt, offset ); 1447 var parentPt = vecUtils.vecAdd(3, scrPt, offset );
1448 var globalPt = viewUtils.localToGlobal( parentPt, elt.parentElement ); 1448 var globalPt = viewUtils.localToGlobal( parentPt, elt.offsetParent );
1449 1449
1450 var dist = vecUtils.vecDist(2, globalPt, targetScrPt ); 1450 var dist = vecUtils.vecDist(2, globalPt, targetScrPt );
1451 if (dist < this.ELEMENT_VERTEX_HIT_RAD) 1451 if (dist < this.ELEMENT_VERTEX_HIT_RAD)
@@ -1483,7 +1483,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1483 var offset = viewUtils.getElementOffset( elt ); 1483 var offset = viewUtils.getElementOffset( elt );
1484 MathUtils.makeDimension3( offset ); 1484 MathUtils.makeDimension3( offset );
1485 var parentPt = vecUtils.vecAdd(3, scrPt, offset ); 1485 var parentPt = vecUtils.vecAdd(3, scrPt, offset );
1486 var globalPt = viewUtils.localToGlobal( parentPt, elt.parentElement ); 1486 var globalPt = viewUtils.localToGlobal( parentPt, elt.offsetParent );
1487 1487
1488 var dist = vecUtils.vecDist(2, globalPt, targetScrPt ); 1488 var dist = vecUtils.vecDist(2, globalPt, targetScrPt );
1489 if (dist < this.ELEMENT_EDGE_HIT_RAD) 1489 if (dist < this.ELEMENT_EDGE_HIT_RAD)