diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-14 18:43:22 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-14 18:43:22 +0100 |
commit | af45360b7b2a8dc3f3eaed553f9544b4318e7348 (patch) | |
tree | 8da54a60d1c23854239996bc5318ccb87e8f1b15 /src/pointarray.js | |
parent | 4b6e28689412a3fda9a52f2e665dbc536c87cd8f (diff) | |
download | svg.js-af45360b7b2a8dc3f3eaed553f9544b4318e7348.tar.gz svg.js-af45360b7b2a8dc3f3eaed553f9544b4318e7348.zip |
move most regexe to SVG.regex, fix matrix constructor for string argument
Diffstat (limited to 'src/pointarray.js')
-rw-r--r-- | src/pointarray.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pointarray.js b/src/pointarray.js index 58166a3..b0a3d54 100644 --- a/src/pointarray.js +++ b/src/pointarray.js @@ -53,7 +53,7 @@ SVG.extend(SVG.PointArray, { } } else { // Else, it is considered as a string // parse points - array = array.trim().split(/[\s,]+/) + array = array.trim().split(SVG.regex.delimiter).map(parseFloat) } // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints @@ -62,7 +62,7 @@ SVG.extend(SVG.PointArray, { // wrap points in two-tuples and parse points as floats for(var i = 0, len = array.length; i < len; i = i + 2) - points.push([ parseFloat(array[i]), parseFloat(array[i+1]) ]) + points.push([ array[i], array[i+1] ]) return points } |