mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Avoid error when SVG path data does not contain any 'm' commands.
Fixes #529
This commit is contained in:
parent
ee27fe820f
commit
48e9447c47
1 changed files with 1 additions and 1 deletions
|
@ -133,7 +133,7 @@ new function() {
|
||||||
param = { pathData: data };
|
param = { pathData: data };
|
||||||
// If there are multiple moveTo commands or a closePath command followed
|
// If there are multiple moveTo commands or a closePath command followed
|
||||||
// by other commands, we have a CompoundPath:
|
// by other commands, we have a CompoundPath:
|
||||||
return data.match(/m/gi).length > 1 || /z\S+/i.test(data)
|
return (data.match(/m/gi) || []).length > 1 || /z\S+/i.test(data)
|
||||||
? new CompoundPath(param)
|
? new CompoundPath(param)
|
||||||
: new Path(param);
|
: new Path(param);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue