-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
There was a prior PR #27523 that attempted to change it to an approximation, which was based on this article (by a company selling an app which creates such approximations): https://www.paintcodeapp.com/news/code-for-ios-7-rounded-rectangles
I'd imagine Apple uses a specific bezier curve and suspect that many of the lineTos within that code are probably just due to discrete pixels that happen to line up.
That said, SwiftUI (not exactly sure when it was made a public API) now includes RoundedRectangle with RoundedCornerStyle.continuous.
This seems to be similar to the aforementioned approximation, but does NOT match iOS 15's built-in apps. Specifically, the grouped sections within Settings. The closest approximation for those sections seems to be with a cornerRadius of ~10.2.
Although Apple's own implementations aren't consistent, Flutter's ContinuousRectangleBorder should probably match one of them (probably the SwiftUI RoundedRectangle as that's the primary public API analogue).
Currently, ContinuousRectangleBorder requires a borderRadius of ~24 to resemble the RoundedRectangle with a cornerRadius of ~10.2
Metadata
Metadata
Assignees
Labels
Type
Projects
Status