aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/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 6d9a7355..9cf97e09 100644
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -510,12 +510,37 @@ exports.Stage = Montage.create(Component, {
510 */ 510 */
511 GetElement: { 511 GetElement: {
512 value: function(pos) { 512 value: function(pos) {
513 var point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(pos.pageX, pos.pageY)); 513 var point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(pos.pageX, pos.pageY)),
514 return this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); 514 elt = this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop);
515
516 // workaround Chrome 3d bug
517 if(elt === this._viewport)
518 {
519 return this._getElementUsingSnapping(point);
520 } else {
521 return elt;
522 }
515 } 523 }
516 }, 524 },
517 525
518 526 /**
527 * _getElementUsingSnapping: Returns the object at point using snap manager
528 *
529 * @param: point
530 * @return: Returns the Object in the user document under the point
531 */
532 _getElementUsingSnapping: {
533 value: function(point) {
534 this.stageDeps.snapManager.enableElementSnap( true );
535 var hitRec = this.stageDeps.snapManager.snap(point.x, point.y, true);
536 this.stageDeps.snapManager.enableElementSnap( this.stageDeps.snapManager.elementSnapEnabledAppLevel() );
537 if (hitRec) {
538 return hitRec.getElement();
539 } else {
540 return null;
541 }
542 }
543 },
519 544
520 545
521 draw: { 546 draw: {