Bug Report: svg transforms not working if supplied in certain order

Hi,
I have some trouble using svg files with lots of transforms in them. I have reduced it to this minimal example, which should render a 1mm rectangle rotated by 45deg. In broken.svg, the transforms are ignored entirely and I get a huge straight square. These programs render both files the same way: Illustrator, Inkscape, Chrome, Firefox.

working.svg

image
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" encoding="utf-8" xmlns="http://www.w3.org/2000/svg" width="10mm" height="10mm" viewBox="-5 -5 10 10">
<rect width="1000" height="1000" transform="scale(0.001,0.001) translate(45)"/>
</svg>

broken.svg

image
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" encoding="utf-8" xmlns="http://www.w3.org/2000/svg" width="10mm" height="10mm" viewBox="-5 -5 10 10">
<rect width="1000" height="1000" transform="translate(45) scale(0.001,0.001)"/>
</svg>

The only difference between the two files is the order of transformations.

Other transforms that should work, which you might want to use for further testing:

  • transform="translate(26.903,10.179) rotate(90.006084) translate(-2.5,1.25) scale(0.005,0.005)"
  • transform="rotate(-180 -33.333333333333314 5.886495721976846) translate(-33.333,5.886) scale(0.004,0.004)"

I am using Lightburn 0.9.09.

This is fixed for the next release.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.