diff options
author | Nivesh Rajbhandari | 2012-03-20 06:04:41 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-20 06:04:41 -0700 |
commit | fff3c568e6884a867527390b9b77f45c63944aec (patch) | |
tree | c8b52cff1ced8bfdc4b69fdc779c7fb30259c204 /js | |
parent | e4159f8cea57077c755030a421c091b28c7a8ecc (diff) | |
download | ninja-fff3c568e6884a867527390b9b77f45c63944aec.tar.gz |
Removing zoom from element's getMatrix. Zoom should only be checked on stage.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-x | js/controllers/elements/element-controller.js | 16 | ||||
-rwxr-xr-x | js/controllers/elements/stage-controller.js | 41 |
2 files changed, 41 insertions, 16 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 70aba54e..b35251ad 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -228,22 +228,6 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, | |||
228 | mat = this.transformStringToMat( xformStr ); | 228 | mat = this.transformStringToMat( xformStr ); |
229 | if (!mat) | 229 | if (!mat) |
230 | mat = Matrix.I(4); | 230 | mat = Matrix.I(4); |
231 | |||
232 | var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom"); | ||
233 | if (zoom) | ||
234 | { | ||
235 | zoom = Number(zoom); | ||
236 | if (zoom != 1) | ||
237 | { | ||
238 | var zoomMat = Matrix.create( [ | ||
239 | [ zoom, 0, 0, 0], | ||
240 | [ 0, zoom, 0, 0], | ||
241 | [ 0, 0, zoom, 0], | ||
242 | [ 0, 0, 0, 1] | ||
243 | ] ); | ||
244 | glmat4.multiply( zoomMat, mat, mat ); | ||
245 | } | ||
246 | } | ||
247 | } | 231 | } |
248 | 232 | ||
249 | el.elementModel.props3D.matrix3d = mat; | 233 | el.elementModel.props3D.matrix3d = mat; |
diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js index 34bb1fb5..97ea3aa5 100755 --- a/js/controllers/elements/stage-controller.js +++ b/js/controllers/elements/stage-controller.js | |||
@@ -129,5 +129,46 @@ exports.StageController = Montage.create(ElementController, { | |||
129 | value: function(el, rule, selector) { | 129 | value: function(el, rule, selector) { |
130 | el.elementModel.transitionStopRule.selectorText = selector; | 130 | el.elementModel.transitionStopRule.selectorText = selector; |
131 | } | 131 | } |
132 | }, | ||
133 | |||
134 | getMatrix: { | ||
135 | value: function(el) { | ||
136 | if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d) | ||
137 | { | ||
138 | return el.elementModel.props3D.matrix3d.slice(0); | ||
139 | } | ||
140 | else | ||
141 | { | ||
142 | var mat; | ||
143 | |||
144 | if (el) | ||
145 | { | ||
146 | var xformStr = this.application.ninja.elementMediator.getProperty(el, "-webkit-transform"); | ||
147 | if (xformStr) | ||
148 | mat = this.transformStringToMat( xformStr ); | ||
149 | if (!mat) | ||
150 | mat = Matrix.I(4); | ||
151 | |||
152 | var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom"); | ||
153 | if (zoom) | ||
154 | { | ||
155 | zoom = Number(zoom); | ||
156 | if (zoom != 1) | ||
157 | { | ||
158 | var zoomMat = Matrix.create( [ | ||
159 | [ zoom, 0, 0, 0], | ||
160 | [ 0, zoom, 0, 0], | ||
161 | [ 0, 0, zoom, 0], | ||
162 | [ 0, 0, 0, 1] | ||
163 | ] ); | ||
164 | glmat4.multiply( zoomMat, mat, mat ); | ||
165 | } | ||
166 | } | ||
167 | } | ||
168 | |||
169 | el.elementModel.props3D.matrix3d = mat; | ||
170 | return mat; | ||
171 | } | ||
172 | } | ||
132 | } | 173 | } |
133 | }); | 174 | }); |