correct import of paths with several "M/m" and "Z/z"
parent
0e648e7fd8
commit
c761cb68b7
|
@ -1256,6 +1256,10 @@ svgedit.utilities.convertPath = function(path, toRel) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 1: // z,Z closepath (Z/z)
|
case 1: // z,Z closepath (Z/z)
|
||||||
d += 'z';
|
d += 'z';
|
||||||
|
if (last_m && !toRel) {
|
||||||
|
curx = last_m[0];
|
||||||
|
cury = last_m[1];
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 12: // absolute horizontal line (H)
|
case 12: // absolute horizontal line (H)
|
||||||
x -= curx;
|
x -= curx;
|
||||||
|
@ -1292,12 +1296,6 @@ svgedit.utilities.convertPath = function(path, toRel) {
|
||||||
y -= cury;
|
y -= cury;
|
||||||
case 5: // relative line (l)
|
case 5: // relative line (l)
|
||||||
case 3: // relative move (m)
|
case 3: // relative move (m)
|
||||||
// If the last segment was a "z", this must be relative to
|
|
||||||
if (last_m && segList.getItem(i-1).pathSegType === 1 && !toRel) {
|
|
||||||
curx = last_m[0];
|
|
||||||
cury = last_m[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
case 19: // relative smooth quad (t)
|
case 19: // relative smooth quad (t)
|
||||||
if (toRel) {
|
if (toRel) {
|
||||||
curx += x;
|
curx += x;
|
||||||
|
@ -1308,7 +1306,7 @@ svgedit.utilities.convertPath = function(path, toRel) {
|
||||||
curx = x;
|
curx = x;
|
||||||
cury = y;
|
cury = y;
|
||||||
}
|
}
|
||||||
if (type === 3) {last_m = [curx, cury];}
|
if (type === 2 || type === 3) {last_m = [curx, cury];}
|
||||||
|
|
||||||
d += pathDSegment(letter,[[x, y]]);
|
d += pathDSegment(letter,[[x, y]]);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue