From fff3c568e6884a867527390b9b77f45c63944aec Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 20 Mar 2012 06:04:41 -0700 Subject: Removing zoom from element's getMatrix. Zoom should only be checked on stage. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/stage-controller.js | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'js/controllers/elements/stage-controller.js') 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, { value: function(el, rule, selector) { el.elementModel.transitionStopRule.selectorText = selector; } + }, + + getMatrix: { + value: function(el) { + if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d) + { + return el.elementModel.props3D.matrix3d.slice(0); + } + else + { + var mat; + + if (el) + { + var xformStr = this.application.ninja.elementMediator.getProperty(el, "-webkit-transform"); + if (xformStr) + mat = this.transformStringToMat( xformStr ); + if (!mat) + mat = Matrix.I(4); + + var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom"); + if (zoom) + { + zoom = Number(zoom); + if (zoom != 1) + { + var zoomMat = Matrix.create( [ + [ zoom, 0, 0, 0], + [ 0, zoom, 0, 0], + [ 0, 0, zoom, 0], + [ 0, 0, 0, 1] + ] ); + glmat4.multiply( zoomMat, mat, mat ); + } + } + } + + el.elementModel.props3D.matrix3d = mat; + return mat; + } + } } }); -- cgit v1.2.3