SVGSurface: Use horizontal and vertial lines

instead for just regular lines. This saves one number per point involved.
This commit is contained in:
Florian Festi 2020-04-06 19:57:24 +02:00
parent 9e08691e15
commit 492e7fb4dd
1 changed files with 6 additions and 1 deletions

View File

@ -455,6 +455,11 @@ Creation date: {date}
if C == "M": if C == "M":
p.append(f"M {x:.3f} {y:.3f}") p.append(f"M {x:.3f} {y:.3f}")
elif C == "L": elif C == "L":
if abs(x - x0) < EPS:
p.append(f"V {y:.3f}")
elif abs(y - y0) < EPS:
p.append(f"H {x:.3f}")
else:
p.append(f"L {x:.3f} {y:.3f}") p.append(f"L {x:.3f} {y:.3f}")
elif C == "C": elif C == "C":
x1, y1, x2, y2 = c[3:] x1, y1, x2, y2 = c[3:]