aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-04-11 11:05:12 -0700
committerNivesh Rajbhandari2012-04-11 11:05:12 -0700
commit2bf707156eafeb5f6166c6f28cd385ef2c4b5a50 (patch)
tree1d2d35d0d8c99deed99d4e180f15bd81353c381e /js/helper-classes
parent9d1c919a4865ab1a2b0b0b9fc893a54b145c82c0 (diff)
downloadninja-2bf707156eafeb5f6166c6f28cd385ef2c4b5a50.tar.gz
offsets should be calculated on offsetParent instead of parentElement.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/helper-classes')
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js8
-rwxr-xr-xjs/helper-classes/3D/view-utils.js18
2 files changed, 13 insertions, 13 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)
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js
index 55ecbc59..4a6c2503 100755
--- a/js/helper-classes/3D/view-utils.js
+++ b/js/helper-classes/3D/view-utils.js
@@ -259,7 +259,7 @@ exports.ViewUtils = Montage.create(Component, {
259 259
260 // transform the point up the tree 260 // transform the point up the tree
261 var child = elt; 261 var child = elt;
262 var parent = elt.parentElement; 262 var parent = elt.offsetParent;
263 while ( parent ) 263 while ( parent )
264 { 264 {
265 // go to screen space of the current child 265 // go to screen space of the current child
@@ -287,7 +287,7 @@ exports.ViewUtils = Montage.create(Component, {
287 } 287 }
288 288
289 child = parent; 289 child = parent;
290 parent = parent.parentElement; 290 parent = parent.offsetParent;
291 } 291 }
292 292
293 return pt; 293 return pt;
@@ -303,7 +303,7 @@ exports.ViewUtils = Montage.create(Component, {
303 303
304 // transform the bounds up the tree 304 // transform the bounds up the tree
305 var child = elt; 305 var child = elt;
306 var parent = elt.parentElement; 306 var parent = elt.offsetParent;
307 while ( parent ) 307 while ( parent )
308 { 308 {
309 pt = this.childToParent( pt, child ); 309 pt = this.childToParent( pt, child );
@@ -311,7 +311,7 @@ exports.ViewUtils = Montage.create(Component, {
311 if (parent === this._rootElement) break; 311 if (parent === this._rootElement) break;
312 312
313 child = parent; 313 child = parent;
314 parent = parent.parentElement; 314 parent = parent.offsetParent;
315 } 315 }
316 316
317 ///////////////////////////////////////////////////////// 317 /////////////////////////////////////////////////////////
@@ -346,7 +346,7 @@ exports.ViewUtils = Montage.create(Component, {
346 if (pt.length == 2) pt[2] = 0; 346 if (pt.length == 2) pt[2] = 0;
347 347
348 // transform the bounds up the tree 348 // transform the bounds up the tree
349 var parent = child.parentElement; 349 var parent = child.offsetParent;
350 if ( parent ) 350 if ( parent )
351 { 351 {
352 this.setViewportObj( child ); 352 this.setViewportObj( child );
@@ -394,7 +394,7 @@ exports.ViewUtils = Montage.create(Component, {
394 pt[3] = 1; 394 pt[3] = 1;
395 395
396 // transform the bounds up the tree 396 // transform the bounds up the tree
397 var parent = child.parentElement; 397 var parent = child.offsetParent;
398 if ( parent ) 398 if ( parent )
399 { 399 {
400 this.setViewportObj( child ); 400 this.setViewportObj( child );
@@ -429,7 +429,7 @@ exports.ViewUtils = Montage.create(Component, {
429 429
430 /* 430 /*
431 this.pushViewportObj( elt ); 431 this.pushViewportObj( elt );
432 var parent = elt.parentElement; 432 var parent = elt.offsetParent;
433 var offset = this.getElementOffset( elt ); 433 var offset = this.getElementOffset( elt );
434 offset[2] = 0; 434 offset[2] = 0;
435 var localEyePt = this.getCenterOfProjection(); 435 var localEyePt = this.getCenterOfProjection();
@@ -987,7 +987,7 @@ exports.ViewUtils = Montage.create(Component, {
987 987
988 if (elt === this._stageElement) break; 988 if (elt === this._stageElement) break;
989 if (elt === this._rootElement) break; 989 if (elt === this._rootElement) break;
990 elt = elt.parentElement; 990 elt = elt.offsetParent;
991 if (elt === this._rootElement) break; 991 if (elt === this._rootElement) break;
992 } 992 }
993 993
@@ -1040,7 +1040,7 @@ exports.ViewUtils = Montage.create(Component, {
1040 //mat = offMat.multiply( mat ); 1040 //mat = offMat.multiply( mat );
1041 glmat4.multiply( offMat, mat, mat ); 1041 glmat4.multiply( offMat, mat, mat );
1042 1042
1043 elt = elt.parentElement; 1043 elt = elt.offsetParent;
1044 } 1044 }
1045 1045
1046 return mat; 1046 return mat;