From 952e0b2c28af081041fa8987c3e865b931d052fa Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 9 Apr 2012 16:04:24 -0700 Subject: Single perspective fix. Note that rotating multiple objects when the stage is rotated still doesn't work and flatten still doesn't work. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/element-controller.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index fda3a3c5..7ab6664f 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -249,10 +249,6 @@ exports.ElementController = Montage.create(Component, { else { var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, false); - if(dist == null) { - dist = 1400; - } - el.elementModel.props3D.perspectiveDist = dist; return dist; } @@ -266,9 +262,13 @@ exports.ElementController = Montage.create(Component, { mat = props[index]["mat"]; this.application.ninja.stylesController.setElementStyle(el, "-webkit-transform", - "perspective(" + dist + ") " + "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")"); + // TODO - We don't support perspective on individual elements yet +// this.application.ninja.stylesController.setElementStyle(el, +// "-webkit-perspective", +// dist); + el.elementModel.props3D.matrix3d = mat; el.elementModel.props3D.perspectiveDist = dist; -- cgit v1.2.3 From 3bbf32b285405562471fa594c283e271d347734e Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 12 Apr 2012 10:52:32 -0700 Subject: Borders are not factored into offset calculations by the browser, so we have to adjust for them. Also, we should set webkit-transform-style to preserve-3d if elements are rotated (until we also support flattened mode). Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/element-controller.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 7ab6664f..2ac84452 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -264,6 +264,10 @@ exports.ElementController = Montage.create(Component, { "-webkit-transform", "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")"); + this.application.ninja.stylesController.setElementStyle(el, + "-webkit-transform-style", + "preserve-3d"); + // TODO - We don't support perspective on individual elements yet // this.application.ninja.stylesController.setElementStyle(el, // "-webkit-perspective", -- cgit v1.2.3