mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -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) {
|
switch (lower) {
|
||||||
case 'm':
|
case 'm':
|
||||||
case 'l':
|
case 'l':
|
||||||
|
var move = lower === 'm';
|
||||||
|
if (move && previous && previous !== 'z')
|
||||||
|
this.closePath();
|
||||||
for (var j = 0; j < length; j += 2)
|
for (var j = 0; j < length; j += 2)
|
||||||
this[j === 0 && lower === 'm' ? 'moveTo' : 'lineTo'](
|
this[j === 0 && move ? 'moveTo' : 'lineTo'](
|
||||||
current = getPoint(j));
|
current = getPoint(j));
|
||||||
control = current;
|
control = current;
|
||||||
if(lower === 'm')
|
if (move)
|
||||||
start = current;
|
start = current;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
|
|
Loading…
Reference in a new issue