When drawing an SVG shape (with style disabled) using the P2D renderer, the rendering will glitch if the shape is drawn more than once with a different stroke weight.
Run the sketch in this repo or follow steps below:
- Set up sketch with P2D renderer.
- Load an SVG into a PShape and call
disableStyle()
on it. - Draw the shape to the screen once, then change
strokeWeight
and draw again.
The shape should appear on the canvas twice, at different stroke weights.
Example drawn with default renderer:
The first shape appears as expected. The second shape (drawn after changing strokeWeight
) is drawn with a glitched stroke.
Example drawn with P2D renderer:
- Using the default renderer works as expected
- Drawing the shape only once (with any stroke weight) works as expected
- Drawing the shape multiple times without changing stroke weight works as expected
- Loading the same SVG into a separate PShape instance to render as the second graphic works as expected