diff options
author | Jonathan Duran | 2012-06-25 08:13:24 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-06-25 08:13:24 -0700 |
commit | da3d11366fa6f42a99cbd8998eebd5fe572b76bc (patch) | |
tree | e0061fae257c1af54559562e24163b9f6db4f8d9 /js/helper-classes/3D/view-utils.js | |
parent | 21edfc9a02df0ab4360d5eb41f9ef036500c681b (diff) | |
parent | 0f62fd5d06af6933530a151126fe054bf1b68419 (diff) | |
download | ninja-da3d11366fa6f42a99cbd8998eebd5fe572b76bc.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Diffstat (limited to 'js/helper-classes/3D/view-utils.js')
-rwxr-xr-x | js/helper-classes/3D/view-utils.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 5a128408..d7f29caa 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js | |||
@@ -244,6 +244,38 @@ exports.ViewUtils = Montage.create(Component, { | |||
244 | } | 244 | } |
245 | }, | 245 | }, |
246 | 246 | ||
247 | getElementBoundsInGlobal: { | ||
248 | value: function (elt) { | ||
249 | this.pushViewportObj(elt); | ||
250 | var bounds3D = this.getElementViewBounds3D(elt); | ||
251 | var tmpMat = this.getLocalToGlobalMatrix(elt); | ||
252 | |||
253 | var zoomFactor = 1; | ||
254 | var stage = this.application.ninja.stage; | ||
255 | if (stage._viewport && stage._viewport.style && stage._viewport.style.zoom) { | ||
256 | zoomFactor = Number(stage._viewport.style.zoom); | ||
257 | } | ||
258 | |||
259 | var sSL = stage._scrollLeft; | ||
260 | var sST = stage._scrollTop; | ||
261 | |||
262 | for (var j=0; j<4; j++) { | ||
263 | var localPt = bounds3D[j]; | ||
264 | var tmpPt = this.localToGlobal2(localPt, tmpMat); | ||
265 | |||
266 | if(zoomFactor !== 1) { | ||
267 | tmpPt = vecUtils.vecScale(3, tmpPt, zoomFactor); | ||
268 | |||
269 | tmpPt[0] += sSL*(zoomFactor - 1); | ||
270 | tmpPt[1] += sST*(zoomFactor - 1); | ||
271 | } | ||
272 | bounds3D[j] = tmpPt; | ||
273 | } | ||
274 | this.popViewportObj(); | ||
275 | return bounds3D; | ||
276 | } | ||
277 | }, | ||
278 | |||
247 | getCenterOfProjection: { | 279 | getCenterOfProjection: { |
248 | value: function() { | 280 | value: function() { |
249 | var cop; | 281 | var cop; |