Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable RoundedRect to change the radius on all four corners #138

Closed
N3xed opened this issue Sep 29, 2020 · 1 comment · Fixed by #166
Closed

Enable RoundedRect to change the radius on all four corners #138

N3xed opened this issue Sep 29, 2020 · 1 comment · Fixed by #166

Comments

@N3xed
Copy link

N3xed commented Sep 29, 2020

Currently, to do this, you'd have to do the same thing as the Shape implementation for RoundedRect does, with the exception that each corner could have a different radius (or none). It would also make it much easier to implement styling of all corners in druid.

The overhead on RoundedRect would be minimal. This could easily be implemented by making RoundedRectPathIter::arcs Option<T>s and adding three more f64 for each corner in RoundedRect. I'm not sure how a non-rounded corner (ie. zero radius) should be specified. Two possibilities are making the radius variables in RoundedRect also Option or when creating the RoundedRectPathIter comparing the radius to some minimum value.

I will implement this if I get the Ok and some feedback on the problem I mentioned.

@ZhennanWu
Copy link

ZhennanWu commented Jul 23, 2023

Just dropping by. It seems that kurbo still lacks the elliptically rounded rectangles, which flutter supports. Basically we just need to use two parameters per corner (radius_X, radius_Y) to describe the rounding radius. Note that this cannot be emulated by an affine transform on existing RoundedRect, since the four corners may use wildly different ellipses.

I haven't really encountered anything significant in Flutter that uses this feature. But this is concerning when trying to emulate Flutter.

Unfortunately, if this is implemented on current RoundedRect, it will be a breaking (?) change. Or we could add a second type (though the name could probably be mouthful). Or we could choose to not implement. If the decision is to implement, I can take time to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants