mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Close previous paths if followed by a new M command.
This commit is contained in:
parent
c63f9516b3
commit
6c7c4d0798
1 changed files with 5 additions and 2 deletions
|
@ -225,11 +225,14 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
|||
switch (lower) {
|
||||
case 'm':
|
||||
case 'l':
|
||||
var move = lower === 'm';
|
||||
if (move && previous && previous !== 'z')
|
||||
this.closePath();
|
||||
for (var j = 0; j < length; j += 2)
|
||||
this[j === 0 && lower === 'm' ? 'moveTo' : 'lineTo'](
|
||||
this[j === 0 && move ? 'moveTo' : 'lineTo'](
|
||||
current = getPoint(j));
|
||||
control = current;
|
||||
if(lower === 'm')
|
||||
if (move)
|
||||
start = current;
|
||||
break;
|
||||
case 'h':
|
||||
|
|
Loading…
Reference in a new issue