aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorEric Guzman2012-02-27 11:13:35 -0800
committerEric Guzman2012-02-27 11:13:35 -0800
commit1a6604a50f6cfbbf0cd6f45ab94b63a001d02162 (patch)
treebbfc75d1be1ff98d22042dbbed4ca93b4a845e0c /js/stage
parent9e8cd4448a6d0f809a55c3bdea8b45ed75339794 (diff)
parent8125c8c6c9431067840d81c46624b6a2dd5eb4a7 (diff)
downloadninja-1a6604a50f6cfbbf0cd6f45ab94b63a001d02162.tar.gz
Merge branch 'refs/heads/master' into CSSPanelUpdates
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 44e14827..641ac247 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -515,12 +515,37 @@ exports.Stage = Montage.create(Component, {
515 */ 515 */
516 GetElement: { 516 GetElement: {
517 value: function(pos) { 517 value: function(pos) {
518 var point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(pos.pageX, pos.pageY)); 518 var point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(pos.pageX, pos.pageY)),
519 return this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); 519 elt = this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop);
520
521 // workaround Chrome 3d bug
522 if(this.application.ninja.currentDocument.inExclusion(elt) !== -1)
523 {
524 return this._getElementUsingSnapping(point);
525 } else {
526 return elt;
527 }
520 } 528 }
521 }, 529 },
522 530
523 531 /**
532 * _getElementUsingSnapping: Returns the object at point using snap manager
533 *
534 * @param: point
535 * @return: Returns the Object in the user document under the point
536 */
537 _getElementUsingSnapping: {
538 value: function(point) {
539 this.stageDeps.snapManager.enableElementSnap( true );
540 var hitRec = this.stageDeps.snapManager.snap(point.x, point.y, true);
541 this.stageDeps.snapManager.enableElementSnap( this.stageDeps.snapManager.elementSnapEnabledAppLevel() );
542 if (hitRec) {
543 return hitRec.getElement();
544 } else {
545 return null;
546 }
547 }
548 },
524 549
525 550
526 draw: { 551 draw: {