meerk40t / svgelements

SVG Parsing for Elements, Paths, and other SVG Objects.
MIT License
132 stars 29 forks source link

Scaling Paths does not seem to work #122

Closed Esser50K closed 2 years ago

Esser50K commented 2 years ago

Basically I have this:

p = Path("M 20,20 L 40,40")
pp = p * "scale(2)"
p == pp -> True
tatarize commented 2 years ago
>>> p = Path("M20,20 L 40,40")
>>> pp = p * "scale(2)"
>>> p == pp
False
tatarize commented 2 years ago
>>> p
Path(Move(end=Point(20,20)), Line(start=Point(20,20), end=Point(40,40)))
>>> pp
Path(Move(end=Point(20,20)), Line(start=Point(20,20), end=Point(40,40)), transform=Matrix(2, 0, 0, 2, 0, 0))
>>> pp.d()
'M 40,40 L 80,80'
>>> p.d()
'M 20,20 L 40,40'

I can't seem to duplicate this report. It appears to apply the matrix correctly and respond as expected.

Esser50K commented 2 years ago

Humm I had worked around it by scaling the points individually afterwards and now I can't seem to replicate it either. Sorry about that, will reopen if I encounter again and have case where this fails.