aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/styles-controller.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-11 10:32:52 -0700
committerValerio Virgillito2012-04-11 10:32:52 -0700
commit9d1c919a4865ab1a2b0b0b9fc893a54b145c82c0 (patch)
tree9ebbe37bf22cb5280882a0ef5b95196fcf163251 /js/controllers/styles-controller.js
parentbd43ce383b050d03b0f92cc923c517febc66ca28 (diff)
parent36df4f454d64c7b43062835495425021ce955b05 (diff)
downloadninja-9d1c919a4865ab1a2b0b0b9fc893a54b145c82c0.tar.gz
Merge pull request #161 from mqg734/PerspectiveFix
IKNinja-812 - Perspective fix
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 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 }