Rename Shape::polygon to Shape::convex_polygon

epaint only supports filling convex polygons (for now)
This commit is contained in:
Emil Ernerfeldt
2021-05-20 22:14:08 +02:00
parent 085233f907
commit 196ddff499
2 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -129,7 +129,7 @@ fn color_slider_1d(ui: &mut Ui, value: &mut f32, color_at: impl Fn(f32) -> Color
let x = lerp(rect.left()..=rect.right(), *value);
let r = rect.height() / 4.0;
let picked_color = color_at(*value);
ui.painter().add(Shape::polygon(
ui.painter().add(Shape::convex_polygon(
vec![
pos2(x - r, rect.bottom()),
pos2(x + r, rect.bottom()),