aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/view-utils.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-22 15:57:43 -0700
committerValerio Virgillito2012-06-22 15:57:43 -0700
commitf5b8f2cc5f2b7e9cff892d7487ce56019bf66d4c (patch)
tree22985c8362329c2a3b9aeb2be49c1b84817ce7d6 /js/helper-classes/3D/view-utils.js
parentd3ca3d60b7a0e1455175612824b351bf841447e0 (diff)
parentcd7ba9648312a3f55fae9c33285be1d9540e13f9 (diff)
downloadninja-f5b8f2cc5f2b7e9cff892d7487ce56019bf66d4c.tar.gz
Merge pull request #324 from mqg734/StageGuides
Draw stage left and top references lines. Also fixed IKNinja-1720.
Diffstat (limited to 'js/helper-classes/3D/view-utils.js')
-rwxr-xr-xjs/helper-classes/3D/view-utils.js32
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;