Accept matrix3d and convert it

This commit is contained in:
Corné Dorrestijn 2015-03-05 15:52:23 +01:00
parent c2baf42145
commit 9201cf7e95

View File

@ -258,7 +258,7 @@ NodeContainer.prototype.getValue = function() {
return value.length === 0 ? (this.node.placeholder || "") : value; return value.length === 0 ? (this.node.placeholder || "") : value;
}; };
NodeContainer.prototype.MATRIX_PROPERTY = /(matrix)\((.+)\)/; NodeContainer.prototype.MATRIX_PROPERTY = /(matrix|matrix3d)\((.+)\)/;
NodeContainer.prototype.TEXT_SHADOW_PROPERTY = /((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g; NodeContainer.prototype.TEXT_SHADOW_PROPERTY = /((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g;
NodeContainer.prototype.TEXT_SHADOW_VALUES = /(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g; NodeContainer.prototype.TEXT_SHADOW_VALUES = /(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g;
NodeContainer.prototype.CLIP = /^rect\((\d+)px,? (\d+)px,? (\d+)px,? (\d+)px\)$/; NodeContainer.prototype.CLIP = /^rect\((\d+)px,? (\d+)px,? (\d+)px,? (\d+)px\)$/;
@ -273,6 +273,11 @@ function parseMatrix(match) {
return match[2].split(",").map(function(s) { return match[2].split(",").map(function(s) {
return parseFloat(s.trim()); return parseFloat(s.trim());
}); });
} else if (match && match[1] === "matrix3d") {
var matrix3d = match[2].split(",").map(function(s) {
return parseFloat(s.trim());
});
return [matrix3d[0], matrix3d[1], matrix3d[4], matrix3d[5], matrix3d[12], matrix3d[13]];
} }
} }