mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
parent
4df2dfb343
commit
73fc111b50
1 changed files with 5 additions and 1 deletions
|
@ -99,8 +99,10 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
||||||
coords = part.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g);
|
coords = part.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g);
|
||||||
var length = coords && coords.length;
|
var length = coords && coords.length;
|
||||||
relative = command === lower;
|
relative = command === lower;
|
||||||
|
// Fix issues with z in the middle of SVG path data, not followed by
|
||||||
|
// a m command, see #413:
|
||||||
if (previous === 'z' && !/[mz]/.test(lower))
|
if (previous === 'z' && !/[mz]/.test(lower))
|
||||||
this.moveTo(current = start);
|
this.moveTo(current);
|
||||||
switch (lower) {
|
switch (lower) {
|
||||||
case 'm':
|
case 'm':
|
||||||
case 'l':
|
case 'l':
|
||||||
|
@ -170,6 +172,8 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
||||||
// Merge first and last segment with Numerical.EPSILON tolerance
|
// Merge first and last segment with Numerical.EPSILON tolerance
|
||||||
// to address imprecisions in relative SVG data.
|
// to address imprecisions in relative SVG data.
|
||||||
this.closePath(/*#=*/Numerical.EPSILON);
|
this.closePath(/*#=*/Numerical.EPSILON);
|
||||||
|
// Correctly handle relative m commands, see #1101:
|
||||||
|
current = start;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
previous = lower;
|
previous = lower;
|
||||||
|
|
Loading…
Reference in a new issue