aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements/stage-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/elements/stage-controller.js')
-rwxr-xr-xjs/controllers/elements/stage-controller.js58
1 files changed, 23 insertions, 35 deletions
diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js
index f376e40f..3ef7dacc 100755
--- a/js/controllers/elements/stage-controller.js
+++ b/js/controllers/elements/stage-controller.js
@@ -31,46 +31,34 @@ exports.StageController = Montage.create(ElementController, {
31 } 31 }
32 }, 32 },
33 33
34
34 // TODO - perspective distance needs to be passed in as "dist" and matrix3d needs to be passed in as "mat" 35 // TODO - perspective distance needs to be passed in as "dist" and matrix3d needs to be passed in as "mat"
35 set3DProperties: { 36 set3DProperties: {
36 value: function(el, props, index, update3DModel) { 37 value: function(el, props, update3DModel) {
37 var dist = props[index]["dist"], 38 var dist = props["dist"], mat = props["mat"];
38 mat = props[index]["mat"]; 39 this.application.ninja.stylesController.setElementStyle(el, "-webkit-transform", "perspective(" + dist + ") " + "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")", true);
39 this.application.ninja.stylesController.setElementStyle(el, 40
40 "-webkit-transform", 41 el.elementModel.props3D.matrix3d = mat;
41 "perspective(" + dist + ") " + 42 el.elementModel.props3D.perspectiveDist = dist;
42 "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")",
43 true);
44
45 el.elementModel.props3D.matrix3d = mat;
46 el.elementModel.props3D.perspectiveDist = dist;
47
48 // TODO - Move this to matrix class
49 if(this._isRotated(mat))
50 {
51 this.application.ninja.currentDocument.stageBG.style.display = "none";
52 }
53 else
54 {
55 this.application.ninja.stylesController.setElementStyle(this.application.ninja.currentDocument.stageBG,
56 "-webkit-transform",
57 "perspective(" + dist + ") " +
58 "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")",
59 true);
60
61 this.application.ninja.currentDocument.stageBG.elementModel.props3D.matrix3d = mat;
62 this.application.ninja.currentDocument.stageBG.elementModel.props3D.perspectiveDist = dist;
63 this.application.ninja.currentDocument.stageBG.style.display = "block";
64 }
65 43
66 this.application.ninja.stage.updatedStage = true; 44 // TODO - Move this to matrix class
45 if(this._isRotated(mat)) {
46 this.application.ninja.currentDocument.stageBG.style.display = "none";
47 } else {
48 this.application.ninja.stylesController.setElementStyle(this.application.ninja.currentDocument.stageBG, "-webkit-transform", "perspective(" + dist + ") " + "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")", true);
67 49
68 if(update3DModel) 50 this.application.ninja.currentDocument.stageBG.elementModel.props3D.matrix3d = mat;
69 { 51 this.application.ninja.currentDocument.stageBG.elementModel.props3D.perspectiveDist = dist;
70 this._update3DProperties(el, mat, dist); 52 this.application.ninja.currentDocument.stageBG.style.display = "block";
53 }
54
55 this.application.ninja.stage.updatedStage = true;
56
57 if(update3DModel) {
58 this._update3DProperties(el, mat, dist);
59 }
71 } 60 }
72 } 61 },
73 },
74 62
75 getProperty: { 63 getProperty: {
76 value: function(el, p) { 64 value: function(el, p) {