aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-23 10:37:04 -0800
committerJose Antonio Marquez2012-02-23 10:37:04 -0800
commit287a0bad5b774a380ec6c8b3ddf24dc03234e248 (patch)
treeedffa1dd9df53f26da4135068686997ccfbdf083 /js/stage
parent14a8f4c4e373db213b3d42d30edaea8354ae57e3 (diff)
parentcc295dd0fb873505eed01c232bd987cf6e2dcdd9 (diff)
downloadninja-287a0bad5b774a380ec6c8b3ddf24dc03234e248.tar.gz
Merge branch 'refs/heads/NinjaInternal' into FileIO
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/stage.reel/stage.js31
1 files changed, 28 insertions, 3 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index 6536a45d..8d664f25 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -517,12 +517,37 @@ exports.Stage = Montage.create(Component, {
517 */ 517 */
518 GetElement: { 518 GetElement: {
519 value: function(pos) { 519 value: function(pos) {
520 var point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(pos.pageX, pos.pageY)); 520 var point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(pos.pageX, pos.pageY)),
521 return this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); 521 elt = this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop);
522
523 // workaround Chrome 3d bug
524 if(this.application.ninja.currentDocument.inExclusion(elt) !== -1)
525 {
526 return this._getElementUsingSnapping(point);
527 } else {
528 return elt;
529 }
522 } 530 }
523 }, 531 },
524 532
525 533 /**
534 * _getElementUsingSnapping: Returns the object at point using snap manager
535 *
536 * @param: point
537 * @return: Returns the Object in the user document under the point
538 */
539 _getElementUsingSnapping: {
540 value: function(point) {
541 this.stageDeps.snapManager.enableElementSnap( true );
542 var hitRec = this.stageDeps.snapManager.snap(point.x, point.y, true);
543 this.stageDeps.snapManager.enableElementSnap( this.stageDeps.snapManager.elementSnapEnabledAppLevel() );
544 if (hitRec) {
545 return hitRec.getElement();
546 } else {
547 return null;
548 }
549 }
550 },
526 551
527 552
528 draw: { 553 draw: {