diff options
author | Valerio Virgillito | 2012-04-12 18:07:54 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-04-12 18:07:54 -0700 |
commit | 5b4826eced782fe7b4691d4bbbe0e3605d3164c1 (patch) | |
tree | a1fe692c814d75f05da466eead26579e4686175d /js/controllers/styles-controller.js | |
parent | 6885e66a1f668f34699145f0da231c5d4ecbe666 (diff) | |
parent | 4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff) | |
download | ninja-5b4826eced782fe7b4691d4bbbe0e3605d3164c1.tar.gz |
Merge branch 'refs/heads/master' into undo-manager
Conflicts:
js/controllers/elements/element-controller.js
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers/styles-controller.js')
-rwxr-xr-x | js/controllers/styles-controller.js | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 5d5f27ba..ec4314f9 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js | |||
@@ -1130,7 +1130,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1130 | 1130 | ||
1131 | getMatrixFromElement : { | 1131 | getMatrixFromElement : { |
1132 | value: function(element, isStage) { | 1132 | value: function(element, isStage) { |
1133 | var xformStr = this.getElementStyle(element, "-webkit-transform", false, isStage), | 1133 | var xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage), |
1134 | mat; | 1134 | mat; |
1135 | 1135 | ||
1136 | if (xformStr) { | 1136 | if (xformStr) { |
@@ -1163,26 +1163,29 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1163 | 1163 | ||
1164 | getPerspectiveDistFromElement : { | 1164 | getPerspectiveDistFromElement : { |
1165 | value: function(element, isStage) { | 1165 | value: function(element, isStage) { |
1166 | var xformStr = this.getElementStyle(element, "-webkit-transform", false, isStage), | 1166 | var xformStr = this.getElementStyle(element, "-webkit-perspective", false, isStage), |
1167 | dist; | 1167 | dist; |
1168 | 1168 | ||
1169 | if (xformStr) { | 1169 | if(xformStr) { |
1170 | var index1 = xformStr.indexOf( "perspective("); | 1170 | dist = parseInt(xformStr); |
1171 | if (index1 >= 0) { | 1171 | } else { |
1172 | index1 += 12; // do not include 'perspective(' | 1172 | xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage); |
1173 | var index2 = xformStr.indexOf( ")", index1 ); | 1173 | if (xformStr) { |
1174 | if (index2 >= 0) { | 1174 | var index1 = xformStr.indexOf( "perspective("); |
1175 | var substr = xformStr.substr( index1, (index2-index1)); | 1175 | if (index1 >= 0) { |
1176 | if (substr && (substr.length > 0)) { | 1176 | index1 += 12; // do not include 'perspective(' |
1177 | dist = parseInt( substr ); | 1177 | var index2 = xformStr.indexOf( ")", index1 ); |
1178 | if (index2 >= 0) { | ||
1179 | var substr = xformStr.substr( index1, (index2-index1)); | ||
1180 | if (substr && (substr.length > 0)) { | ||
1181 | dist = parseInt( substr ); | ||
1182 | } | ||
1178 | } | 1183 | } |
1179 | } | 1184 | } |
1180 | } | 1185 | } |
1181 | } else { | 1186 | } |
1182 | xformStr = this.getElementStyle(element, "-webkit-perspective", false, isStage); | 1187 | if(isNaN(dist)) { |
1183 | if(xformStr) { | 1188 | dist = null; |
1184 | dist = parseInt(xformStr); | ||
1185 | } | ||
1186 | } | 1189 | } |
1187 | return dist; | 1190 | return dist; |
1188 | } | 1191 | } |