Closed SecondFlight closed 3 years ago
Will give this a look through shortly, and will do a release when we land this + #389 (and maybe #387?)
Will give this a look through shortly, and will do a release when we land this + #389 (and maybe #387?)
I'd love to see #389 go in, though I consider it pretty high risk. I don't think #387 is ready, as there are serious unresolved questions in the Direct2D port in particular (and those are not just implementation details, but point to deeper architectural concerns imho).
The most recent commit addresses a major oversight when rendering in Direct2D. See the top-middle here:
versus here:
Sample image 6 has also been updated. I'll have a PR for piet-snapshots shortly.
Okay, I'll update this soon. I was really hoping for a better way to do that, because my version feels really clunky.
That was just sloppy, sorry. I forgot that building and testing piet
doesn't build or test piet-direct2d
or etc.
Now the snapshots are still failing. Not sure what's going on, since they're freshly updated. I'll poke at this more when I get time next, but that may be a couple days.
This PR adds support for this Kurbo patch. This PR points directly at my Kurbo fork, so it probably shouldn't be merged until the Kurbo PR is merged and a new Kurbo version is published.
piet-coregraphics
andpiet-cairo
both get this feature for free, because both platforms use paths for rounded rectangles. I have tested both platforms and verified this.piet-web
should get this feature for free as well, for the same reason. I have not explicitly tested this, but I feel confident about it sinceto_path
is well-tested and is not platform-specific, and RoundedRect is not mentioned in the code.In
piet-svg
, this has been implemented by simply using a bezier curve if the corner radii aren't all equal, and a rounded rectangle if they are. Rounded rectangles in SVG can only have a single radius, and while it's possible to use some clipping magic, I don't think it's worth the effort.Inpiet-direct2d
, this has been implemented by drawing four rounded rectangles, one for each corner. They are clipped using an axis-aligned clip, which is faster than masking with a shape. If all corner radii are equal, a single rounded rectangle is drawn.piet-direct2d
has a similar implementation topiet-svg
.