canvas: Scale stroke width based on shape transform#7042
Conversation
c4c0082 to
f53fc57
Compare
|
@Toad06 Could you give this another test? Thank you! Unfortunately with the canvas API, there's no good way to handle gradient strokes -- the trick that I use for gradient fills can't be applied to strokes, because transforms end up distorting the stroke geometry (joins/endcaps). So this PR takes the middle ground of creating a fresh gradient each frame for strokes, with a "simple" transform (rotation/scale, no skew), which should be good enough in the majority of cases. |
|
This looks good to me, this is really a significant improvement. 😉 (By the way, while testing I did notice a couple of regressions affecting the canvas renderer. They are not related to this PR. I reported them in #7448 before realizing this was an issue you were aware of already 😛) |


Render strokes with the proper width in the canvas backend:
TODO:
core::shape_utilsbecause other renderers will want it as wellCanvasGradientinstance per draw)Fixes the line widths in #751 in the canvas backend.