deeplook / svglib

Read SVG files and convert them to other formats.
GNU Lesser General Public License v3.0
311 stars 80 forks source link

Apply the transformation matrix to the group transform #309

Closed ChrisBuergi closed 2 years ago

ChrisBuergi commented 2 years ago

Apply the transformation matrix to the group transform by matrix multiplication.

If the "values" is directly assigned to the group transform, then the the original transformation of the group is lost.

Use the old code if the length of the "values" is not 6. This is somewhat an undefined state.

ChrisBuergi commented 2 years ago

I do no know how to write a test for this, but here is an example SVG file that renders incorrectly without this patch. The purple rect at the bottom is rendered in the upper left corner without this patch.

test.svg.txt

claudep commented 2 years ago

Thanks a lot for this fix. I added tests and updated Changelog in #311.

ChrisBuergi commented 2 years ago

Thanks for the changes. Much appreciated.