From 9201cf7e95e6e6a5f517157762ca9a57b220e019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corn=C3=A9=20Dorrestijn?= Date: Thu, 5 Mar 2015 15:52:23 +0100 Subject: [PATCH] Accept matrix3d and convert it --- src/nodecontainer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nodecontainer.js b/src/nodecontainer.js index 15737e7..a7a1299 100644 --- a/src/nodecontainer.js +++ b/src/nodecontainer.js @@ -258,7 +258,7 @@ NodeContainer.prototype.getValue = function() { 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_VALUES = /(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g; 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 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]]; } }