aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
authorhwc4872012-05-02 17:00:46 -0700
committerhwc4872012-05-02 17:00:46 -0700
commit571e4518d9550113d5696a61bbc07be8379ff4ac (patch)
treed8e4fc5964ec005b0c75e414c6eb80a3b04b09f4 /js/controllers/elements
parent8eac5582b72115969a9f915f4303535c22018033 (diff)
parent691beb1c39fc0baa683f1fc56cbc519fe58f306d (diff)
downloadninja-571e4518d9550113d5696a61bbc07be8379ff4ac.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-xjs/controllers/elements/body-controller.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js
index 839d0787..14aeae24 100755
--- a/js/controllers/elements/body-controller.js
+++ b/js/controllers/elements/body-controller.js
@@ -51,5 +51,45 @@ exports.BodyController = Montage.create(ElementController, {
51 return dist; 51 return dist;
52 } 52 }
53 } 53 }
54 },
55
56 getMatrix: {
57 value: function(el) {
58 if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d)
59 {
60 return el.elementModel.props3D.matrix3d.slice(0);
61 }
62 else
63 {
64 var mat;
65
66 if (el)
67 {
68 mat = this.application.ninja.stylesController.getMatrixFromElement(el, true);
69 if (!mat) {
70 mat = Matrix.I(4);
71 }
72
73 var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom");
74 if (zoom)
75 {
76 zoom = Number(zoom);
77 if (zoom != 1)
78 {
79 var zoomMat = Matrix.create( [
80 [ zoom, 0, 0, 0],
81 [ 0, zoom, 0, 0],
82 [ 0, 0, zoom, 0],
83 [ 0, 0, 0, 1]
84 ] );
85 glmat4.multiply( zoomMat, mat, mat );
86 }
87 }
88 }
89
90 el.elementModel.props3D.matrix3d = mat;
91 return mat;
92 }
93 }
54 } 94 }
55}); 95});