Is there a known issue with PathEffect.cornerPathEffect? It does not seem to create any corners for my path that consists of 2 lines and 2 arcs, and actually ends up breaking the path I have. Is there any other way to achieve rounded corners for Paths or GenericShapes?
David Breneisen
09/30/2024, 2:51 AM
I’m trying to make the border of these shapes look better. Right now they have the jagged corners and the lines look choppy. Maybe antialiasing is needed?
I was able to achieve the rounded corners in flutter by having the path drawn with a Stroke but that doesn’t have the same effect in compose.
r
romainguy
09/30/2024, 3:14 AM
How are you drawing them? It looks like anti-aliasing is turned off
romainguy
09/30/2024, 3:15 AM
And it's on by default in Compose (unless you are drawing using the native canvas apis and your own paints)
@romainguy I first tried with GenericShape and a Box clipping it, and then tried drawWithCache/drawBehind, and then on a Canvas(). I think the aliasing could be a desktop (mac in my case) issue like Rob said. Any ideas for the rounded corners?
David Breneisen
09/30/2024, 12:33 PM
same choppiness appears for wasm as well, I haven’t done anything to modify the default antialiasing behavior (don’t know how to)