aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
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: {