diff options
Diffstat (limited to 'js/stage')
-rwxr-xr-x | js/stage/stage.reel/stage.js | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 37b1df35..6a8afad4 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js | |||
@@ -518,12 +518,37 @@ exports.Stage = Montage.create(Component, { | |||
518 | */ | 518 | */ |
519 | GetElement: { | 519 | GetElement: { |
520 | value: function(pos) { | 520 | value: function(pos) { |
521 | var point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(pos.pageX, pos.pageY)); | 521 | var point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(pos.pageX, pos.pageY)), |
522 | return this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); | 522 | elt = this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); |
523 | |||
524 | // workaround Chrome 3d bug | ||
525 | if(elt === this._viewport) | ||
526 | { | ||
527 | return this._getElementUsingSnapping(point); | ||
528 | } else { | ||
529 | return elt; | ||
530 | } | ||
523 | } | 531 | } |
524 | }, | 532 | }, |
525 | 533 | ||
526 | 534 | /** | |
535 | * _getElementUsingSnapping: Returns the object at point using snap manager | ||
536 | * | ||
537 | * @param: point | ||
538 | * @return: Returns the Object in the user document under the point | ||
539 | */ | ||
540 | _getElementUsingSnapping: { | ||
541 | value: function(point) { | ||
542 | this.stageDeps.snapManager.enableElementSnap( true ); | ||
543 | var hitRec = this.stageDeps.snapManager.snap(point.x, point.y, true); | ||
544 | this.stageDeps.snapManager.enableElementSnap( this.stageDeps.snapManager.elementSnapEnabledAppLevel() ); | ||
545 | if (hitRec) { | ||
546 | return hitRec.getElement(); | ||
547 | } else { | ||
548 | return null; | ||
549 | } | ||
550 | } | ||
551 | }, | ||
527 | 552 | ||
528 | 553 | ||
529 | draw: { | 554 | draw: { |