mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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);
|
||||
var length = coords && coords.length;
|
||||
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))
|
||||
this.moveTo(current = start);
|
||||
this.moveTo(current);
|
||||
switch (lower) {
|
||||
case 'm':
|
||||
case 'l':
|
||||
|
@ -170,6 +172,8 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
|||
// Merge first and last segment with Numerical.EPSILON tolerance
|
||||
// to address imprecisions in relative SVG data.
|
||||
this.closePath(/*#=*/Numerical.EPSILON);
|
||||
// Correctly handle relative m commands, see #1101:
|
||||
current = start;
|
||||
break;
|
||||
}
|
||||
previous = lower;
|
||||
|
|
Loading…
Reference in a new issue