From e26b56f88e045a50e67a56cd2f452b9ea05ea15b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 6 Nov 2012 10:43:32 -0800 Subject: [PATCH] SvgImporter: Further optimise style parsing. --- src/svg/SvgImporter.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/svg/SvgImporter.js b/src/svg/SvgImporter.js index c24ead4a..06b6e9bb 100644 --- a/src/svg/SvgImporter.js +++ b/src/svg/SvgImporter.js @@ -299,10 +299,7 @@ var SvgImporter = this.SvgImporter = new function() { : entry.type === 'number' ? parseFloat(value, 10) : entry.type === 'array' - ? value.replace(/px/g, '').replace(/, /g, ',') - .replace(/ /g, ',').split(',').map(function(val) { - return parseFloat(val, 10); - }) + ? value.split(/[\s,]+/g).map(parseFloat) : value); } else { switch (name) {