This PR adds an Ellipse widget along with examples to the SwiftUI gallery and Flutter demo apps. Here are the comparisons side by side (SwiftUI is first):
Issues of note
Unlike Rectangle, half the stroke line of an ellipse is painted outside of the ellipse area.
SwiftUI clips the stroke of Ellipse when embedded directly in a VStack. I had to manually ensure the SwiftUI VStack was wide enough to contain the stroke width in order for this not to happen. This behavior is not matched in Flutter. The Flutter VStack does not clip the Ellipse stroke by default:
I'm not sure it's even worth trying to implement this behavior in Flutter since the Flutter default seems better. In any case, this is probably a VStack or Frame issue rather than an Ellipse issue, so I'm not attempting to solve it in this PR.
This PR adds an
Ellipse
widget along with examples to the SwiftUI gallery and Flutter demo apps. Here are the comparisons side by side (SwiftUI is first):Issues of note
Unlike
Rectangle
, half the stroke line of an ellipse is painted outside of the ellipse area.SwiftUI clips the stroke of
Ellipse
when embedded directly in aVStack
. I had to manually ensure the SwiftUIVStack
was wide enough to contain the stroke width in order for this not to happen. This behavior is not matched in Flutter. The FlutterVStack
does not clip theEllipse
stroke by default:I'm not sure it's even worth trying to implement this behavior in Flutter since the Flutter default seems better. In any case, this is probably a
VStack
orFrame
issue rather than anEllipse
issue, so I'm not attempting to solve it in this PR.