diff options
author | Valerio Virgillito | 2012-06-25 11:49:00 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-06-25 11:49:00 -0700 |
commit | de38cd3479bd5865e058938095120fa3526fc9b3 (patch) | |
tree | 063b1b147b246bd93b259a2d84d3bc70928f4174 /js/controllers/elements | |
parent | d24243239f38704580bb3561a3959688b171809b (diff) | |
parent | 11ae8b91c30322074adb3cae753193d0bae3c995 (diff) | |
download | ninja-de38cd3479bd5865e058938095120fa3526fc9b3.tar.gz |
Merge pull request #332 from mqg734/ViewPortHack
Make stage transparent when rotating/zooming templates and draw an outline around the user's root instead.
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-x | js/controllers/elements/body-controller.js | 20 |
1 files changed, 18 insertions, 2 deletions
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, { | |||
19 | el.elementModel.props3D.matrix3d = mat; | 19 | el.elementModel.props3D.matrix3d = mat; |
20 | el.elementModel.props3D.perspectiveDist = dist; | 20 | el.elementModel.props3D.perspectiveDist = dist; |
21 | 21 | ||
22 | if(this.application.ninja.currentDocument.model.views.design._template) { | ||
23 | if(!MathUtils.isIdentityMatrix(mat)) { | ||
24 | el.parentNode.style.backgroundColor = "transparent"; | ||
25 | } else { | ||
26 | el.parentNode.style.removeProperty("background-color"); | ||
27 | } | ||
28 | } | ||
29 | |||
22 | this.application.ninja.stage.updatedStage = true; | 30 | this.application.ninja.stage.updatedStage = true; |
23 | 31 | ||
24 | if(update3DModel) { | 32 | if(update3DModel) { |
@@ -32,7 +40,11 @@ exports.BodyController = Montage.create(ElementController, { | |||
32 | switch(p) { | 40 | switch(p) { |
33 | case "background" : | 41 | case "background" : |
34 | case "background-color": | 42 | case "background-color": |
35 | return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color")); | 43 | if(this.application.ninja.currentDocument.model.views.design._template) { |
44 | return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el.parentNode, "background-color")); | ||
45 | } else { | ||
46 | return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color")); | ||
47 | } | ||
36 | case "border": | 48 | case "border": |
37 | return 0; | 49 | return 0; |
38 | case "height": | 50 | case "height": |
@@ -51,7 +63,11 @@ exports.BodyController = Montage.create(ElementController, { | |||
51 | switch(p) { | 63 | switch(p) { |
52 | case "background": | 64 | case "background": |
53 | case "background-color": | 65 | case "background-color": |
54 | this.application.ninja.stylesController.setElementStyle(el, "background-color", value); | 66 | if(this.application.ninja.currentDocument.model.views.design._template) { |
67 | this.application.ninja.stylesController.setElementStyle(el.parentNode, "background-color", value); | ||
68 | } else { | ||
69 | this.application.ninja.stylesController.setElementStyle(el, "background-color", value); | ||
70 | } | ||
55 | break; | 71 | break; |
56 | case "overflow": | 72 | case "overflow": |
57 | case "width": | 73 | case "width": |