From 9c8fbdd11fdbe9ae73d57147de84b799c5a87652 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 30 Apr 2012 16:15:47 -0700 Subject: Squashed commit of stage architecture Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 2 ++ js/controllers/elements/body-controller.js | 11 +++++++++++ 2 files changed, 13 insertions(+) (limited to 'js/controllers') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 4be0767a..7795a74d 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -483,6 +483,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component, if(!this.webTemplate) { this._showCurrentDocument(); + } else { + this.application.ninja.stage.stageView.showRulers(); } this.webTemplate = false; diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js index fbbb7c6e..839d0787 100755 --- a/js/controllers/elements/body-controller.js +++ b/js/controllers/elements/body-controller.js @@ -12,6 +12,17 @@ exports.BodyController = Montage.create(ElementController, { // TODO - perspective distance needs to be passed in as "dist" and matrix3d needs to be passed in as "mat" set3DProperties: { value: function(el, props, update3DModel) { + var dist = props["dist"], mat = props["mat"]; + this.application.ninja.stylesController.setElementStyle(el, "-webkit-transform", "perspective(" + dist + ") " + "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")", true); + + el.elementModel.props3D.matrix3d = mat; + el.elementModel.props3D.perspectiveDist = dist; + + this.application.ninja.stage.updatedStage = true; + + if(update3DModel) { + this._update3DProperties(el, mat, dist); + } } }, -- cgit v1.2.3