aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorhwc4872012-02-21 17:02:31 -0800
committerhwc4872012-02-21 17:02:31 -0800
commitf06f44ab3fcca109f126eae4f6fb915c5dd28791 (patch)
treec25fbfedf93c135be53f1e9238f7ddcf498612bc /js/stage
parentbd7bc833895391e4974b8746f31f63ba70689df3 (diff)
parentd2f4d5e5f6742d53b6324d585a700566f73c992a (diff)
downloadninja-f06f44ab3fcca109f126eae4f6fb915c5dd28791.tar.gz
Merge branch 'WebGLMaterials' of github.com:mqg734/ninja-internal into integration
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 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: {