diff options
author | hwc487 | 2012-02-21 17:02:31 -0800 |
---|---|---|
committer | hwc487 | 2012-02-21 17:02:31 -0800 |
commit | f06f44ab3fcca109f126eae4f6fb915c5dd28791 (patch) | |
tree | c25fbfedf93c135be53f1e9238f7ddcf498612bc /js/stage | |
parent | bd7bc833895391e4974b8746f31f63ba70689df3 (diff) | |
parent | d2f4d5e5f6742d53b6324d585a700566f73c992a (diff) | |
download | ninja-f06f44ab3fcca109f126eae4f6fb915c5dd28791.tar.gz |
Merge branch 'WebGLMaterials' of github.com:mqg734/ninja-internal into integration
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: { |