aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-23 10:38:51 -0800
committerJose Antonio Marquez2012-02-23 10:38:51 -0800
commitd764428023d87446fbbb153d8e04a23b900d71d5 (patch)
tree2581815db5567b52d4c59663ea9e37d6df057ca3 /js/stage
parent3e1be6d4d4f0d3a2474af7d915954f9b6464fe2e (diff)
parentcc295dd0fb873505eed01c232bd987cf6e2dcdd9 (diff)
downloadninja-d764428023d87446fbbb153d8e04a23b900d71d5.tar.gz
Merge branch 'refs/heads/NinjaInternal' into Color
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: {