aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRémi Tétreault <tetreault.remi@gmail.com>2016-11-01 17:23:06 -0400
committerRémi Tétreault <tetreault.remi@gmail.com>2016-11-01 17:23:06 -0400
commit158fe9e5a415fe9fe89871a71254efef503a8b02 (patch)
tree7ec6bdea2b26785be0adc5f709009efaa111fe5c /src
parent0e4ccbcecb421fd5cae5de5437ae8a5e488d7810 (diff)
downloadsvg.js-158fe9e5a415fe9fe89871a71254efef503a8b02.tar.gz
svg.js-158fe9e5a415fe9fe89871a71254efef503a8b02.zip
Make matrixify work with transformation chain separated by commas
According to the SVG spec, transformation chain can be separated by whitespace and/or commas. The method matrixify was not working with transformation chain separated by commas. This commit should fix that bug.
Diffstat (limited to 'src')
-rw-r--r--src/transform.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/transform.js b/src/transform.js
index 7886c05..1635152 100644
--- a/src/transform.js
+++ b/src/transform.js
@@ -182,7 +182,7 @@ SVG.extend(SVG.Element, {
var matrix = (this.attr('transform') || '')
// split transformations
- .split(/\)\s*/).slice(0,-1).map(function(str){
+ .split(/\)\s*,?\s*/).slice(0,-1).map(function(str){
// generate key => value pairs
var kv = str.trim().split('(')
return [kv[0], kv[1].split(SVG.regex.matrixElements).map(function(str){ return parseFloat(str) })]
@@ -266,9 +266,9 @@ SVG.Transformation = SVG.invent({
for(var i = 0, len = this.arguments.length; i < len; ++i){
o[this.arguments[i]] = typeof this[this.arguments[i]] == 'undefined' ? 0 : o[this.arguments[i]]
}
-
+
this._undo = new SVG[capitalize(this.method)](o, true).at(1)
-
+
return this
}