mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Fix small SVG path-data parser issue.
This commit is contained in:
parent
82cefa9846
commit
5fbc6e939d
2 changed files with 2 additions and 3 deletions
|
@ -8,7 +8,6 @@
|
|||
var start = Date.now();
|
||||
project.importSvg(document.getElementById('svg'));
|
||||
console.log(Date.now() - start);
|
||||
console.log(project.exportJson({ precision: 2 }));
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -78,12 +78,12 @@ var PathItem = this.PathItem = Item.extend(/** @lends PathItem# */{
|
|||
}
|
||||
|
||||
for (var i = 0, l = parts.length; i < l; i++) {
|
||||
var part = parts[i].trim();
|
||||
var part = parts[i];
|
||||
cmd = part[0],
|
||||
lower = cmd.toLowerCase();
|
||||
// Split at white-space, commas but also before signs.
|
||||
// Use positive lookahead to include signs.
|
||||
coords = part.slice(1).split(/[\s,]+|(?=[+-])/);
|
||||
coords = part.slice(1).trim().split(/[\s,]+|(?=[+-])/);
|
||||
relative = cmd === lower;
|
||||
switch (lower) {
|
||||
case 'm':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue