diff options
Diffstat (limited to 'js/stage/stage.reel')
-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 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: { |