Figured out the bug on the line rendering scale. The wrong Matrix property was being scaled.

The Matrix documentation states that

*a* and

*c* are for the X axis and

*b* and

*d* are for the Y axis, but the render was using a combination of Matrix.a and Matrix.c for scaling line thickness.

If you look up SVGRenderer.hx find the following line (around 137, a search for "m.c" finds it quickly)

` var scale = Math.sqrt(m.a*m.a + m.c*m.c);`

and replace it with:

` var scale = Math.sqrt(m.a*m.a + m.d*m.d);`

Now, this still comes with some caveats. Specifically, the matrix doesn't scale correctly if you are only changing one axis. This is because line thickness is scaled equal across the entire line no matter what orientation(s) the line happens to be.

If you scale in both directions equally (maintaining aspect ratio, essentially), then the thickness will adjust accordingly. As noted in my previous post, you can also just convert your lines to shapes and have it handle them as non-line objects safely.

I'll be submitting a pull request to update the github version with this little tweak, but if you're actively working with it it might be worth modifying your own copy.

I note that I modified the one that was pre-included with Stencyl, however old it is.