aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/styles-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/styles-controller.js')
-rwxr-xr-xjs/controllers/styles-controller.js35
1 files changed, 19 insertions, 16 deletions
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js
index 3e56f25c..f7c98023 100755
--- a/js/controllers/styles-controller.js
+++ b/js/controllers/styles-controller.js
@@ -1138,7 +1138,7 @@ var stylesController = exports.StylesController = Montage.create(Component, {
1138 1138
1139 getMatrixFromElement : { 1139 getMatrixFromElement : {
1140 value: function(element, isStage) { 1140 value: function(element, isStage) {
1141 var xformStr = this.getElementStyle(element, "-webkit-transform", false, isStage), 1141 var xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage),
1142 mat; 1142 mat;
1143 1143
1144 if (xformStr) { 1144 if (xformStr) {
@@ -1171,26 +1171,29 @@ var stylesController = exports.StylesController = Montage.create(Component, {
1171 1171
1172 getPerspectiveDistFromElement : { 1172 getPerspectiveDistFromElement : {
1173 value: function(element, isStage) { 1173 value: function(element, isStage) {
1174 var xformStr = this.getElementStyle(element, "-webkit-transform", false, isStage), 1174 var xformStr = this.getElementStyle(element, "-webkit-perspective", false, isStage),
1175 dist; 1175 dist;
1176 1176
1177 if (xformStr) { 1177 if(xformStr) {
1178 var index1 = xformStr.indexOf( "perspective("); 1178 dist = parseInt(xformStr);
1179 if (index1 >= 0) { 1179 } else {
1180 index1 += 12; // do not include 'perspective(' 1180 xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage);
1181 var index2 = xformStr.indexOf( ")", index1 ); 1181 if (xformStr) {
1182 if (index2 >= 0) { 1182 var index1 = xformStr.indexOf( "perspective(");
1183 var substr = xformStr.substr( index1, (index2-index1)); 1183 if (index1 >= 0) {
1184 if (substr && (substr.length > 0)) { 1184 index1 += 12; // do not include 'perspective('
1185 dist = parseInt( substr ); 1185 var index2 = xformStr.indexOf( ")", index1 );
1186 if (index2 >= 0) {
1187 var substr = xformStr.substr( index1, (index2-index1));
1188 if (substr && (substr.length > 0)) {
1189 dist = parseInt( substr );
1190 }
1186 } 1191 }
1187 } 1192 }
1188 } 1193 }
1189 } else { 1194 }
1190 xformStr = this.getElementStyle(element, "-webkit-perspective", false, isStage); 1195 if(isNaN(dist)) {
1191 if(xformStr) { 1196 dist = null;
1192 dist = parseInt(xformStr);
1193 }
1194 } 1197 }
1195 return dist; 1198 return dist;
1196 } 1199 }