1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

epaint: Add EllipseShape (#4122)

Adds an Ellipse shape draw-able with the Painter, brings egui closer to
the SVG Specification.

I've done some optimization towards using less vertices and doing less
calculations.

~~Currently the vertices are evenly distributed.
It's possible this could be optimized further taking into account the
gradient and increasing the concentration of vertices where the change
in gradient is larger.~~


![EllipseTall](https://github.com/emilk/egui/assets/50041841/b105230c-ce68-49c1-b162-d1f066bf9d6a)

![EllipseWide](https://github.com/emilk/egui/assets/50041841/6f9106d2-75cb-4f2a-b0c2-039b3aadec86)
This commit is contained in:
Eris
2024-03-20 12:23:21 +00:00
committed by GitHub
parent 8d47ab8bb9
commit bce257adb3
5 changed files with 154 additions and 3 deletions

View File

@@ -20,6 +20,12 @@ pub fn adjust_colors(shape: &mut Shape, adjust_color: &impl Fn(&mut Color32)) {
fill,
stroke,
})
| Shape::Ellipse(EllipseShape {
center: _,
radius: _,
fill,
stroke,
})
| Shape::Path(PathShape {
points: _,
closed: _,