diff options
author | hwc487 | 2012-05-10 16:53:18 -0700 |
---|---|---|
committer | hwc487 | 2012-05-10 16:53:18 -0700 |
commit | babfa5f1ca4f702920d81d7e12a90b12ffbf42d8 (patch) | |
tree | 1f7cc59301d97db5875e1b515760edaa50b6a9a1 /js/helper-classes/3D/view-utils.js | |
parent | 3e82beb51fe3f596147e9d7f1c405d9a8c4df63b (diff) | |
download | ninja-babfa5f1ca4f702920d81d7e12a90b12ffbf42d8.tar.gz |
Fixed an inaccuracy snapping to the stage.
Diffstat (limited to 'js/helper-classes/3D/view-utils.js')
-rwxr-xr-x | js/helper-classes/3D/view-utils.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 919f7c50..48d4cacf 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js | |||
@@ -288,6 +288,11 @@ exports.ViewUtils = Montage.create(Component, { | |||
288 | value: function( localPt, elt ) { | 288 | value: function( localPt, elt ) { |
289 | this.pushViewportObj( elt ); | 289 | this.pushViewportObj( elt ); |
290 | var viewPt = this.screenToView( localPt[0], localPt[1], localPt[2] ); | 290 | var viewPt = this.screenToView( localPt[0], localPt[1], localPt[2] ); |
291 | if ((elt == null) || (elt === this._stageElement)) | ||
292 | { | ||
293 | this.popViewportObj(); | ||
294 | return viewPt; | ||
295 | } | ||
291 | var mat = this.getMatrixFromElement( elt ); | 296 | var mat = this.getMatrixFromElement( elt ); |
292 | var worldPt = MathUtils.transformPoint( viewPt, mat ); | 297 | var worldPt = MathUtils.transformPoint( viewPt, mat ); |
293 | var stageWorldPt = this.postViewToStageWorld( worldPt, elt ); | 298 | var stageWorldPt = this.postViewToStageWorld( worldPt, elt ); |