mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
b592a72916
# Objective Currently, the `Ellipse` primitive is represented by a `half_width` and `half_height`. To improve consistency (similarly to #11434), it might make more sense to use a `Vec2` `half_size` instead. Alternatively, to make the elliptical nature clearer, the properties could also be called `radius_x` and `radius_y`. Secondly, `Ellipse::new` currently takes a *full* width and height instead of two radii. I would expect it to take the half-width and half-height because ellipses and circles are almost always defined using radii. I wouldn't expect `Circle::new` to take a diameter (if we had that method). ## Solution Change `Ellipse` to store a `half_size` and `new` to take the half-width and half-height. I also added a `from_size` method similar to `Rectangle::from_size`, and added the `semi_minor` and `semi_major` helpers to get the semi-minor/major radius. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |