From 11ae8b91c30322074adb3cae753193d0bae3c995 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 22 Jun 2012 17:02:55 -0700 Subject: Make stage transparent when rotating/zooming templates and draw an outline around the user's root instead. Also, fixed the background color setting on banner and animation templates' "body." Stage outline draws using drawGridLines code so it can show intersection with element planes. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/body-controller.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'js/controllers') diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js index 0ca6c417..604b22d0 100755 --- a/js/controllers/elements/body-controller.js +++ b/js/controllers/elements/body-controller.js @@ -19,6 +19,14 @@ exports.BodyController = Montage.create(ElementController, { el.elementModel.props3D.matrix3d = mat; el.elementModel.props3D.perspectiveDist = dist; + if(this.application.ninja.currentDocument.model.views.design._template) { + if(!MathUtils.isIdentityMatrix(mat)) { + el.parentNode.style.backgroundColor = "transparent"; + } else { + el.parentNode.style.removeProperty("background-color"); + } + } + this.application.ninja.stage.updatedStage = true; if(update3DModel) { @@ -32,7 +40,11 @@ exports.BodyController = Montage.create(ElementController, { switch(p) { case "background" : case "background-color": - return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color")); + if(this.application.ninja.currentDocument.model.views.design._template) { + return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el.parentNode, "background-color")); + } else { + return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color")); + } case "border": return 0; case "height": @@ -51,7 +63,11 @@ exports.BodyController = Montage.create(ElementController, { switch(p) { case "background": case "background-color": - this.application.ninja.stylesController.setElementStyle(el, "background-color", value); + if(this.application.ninja.currentDocument.model.views.design._template) { + this.application.ninja.stylesController.setElementStyle(el.parentNode, "background-color", value); + } else { + this.application.ninja.stylesController.setElementStyle(el, "background-color", value); + } break; case "overflow": case "width": -- cgit v1.2.3