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

Add Rounding::at_least and Rounding::at_most

This commit is contained in:
Emil Ernerfeldt
2022-04-27 10:05:09 +02:00
parent e3b77e320a
commit 06802cb0a0
3 changed files with 24 additions and 13 deletions

View File

@@ -90,13 +90,8 @@ fn color_button(ui: &mut Ui, color: Color32, open: bool) -> Response {
ui.painter().rect_filled(left_half, 0.0, color);
ui.painter().rect_filled(right_half, 0.0, color.to_opaque());
let rounding = Rounding {
nw: visuals.rounding.nw.at_most(2.0),
ne: visuals.rounding.ne.at_most(2.0),
sw: visuals.rounding.sw.at_most(2.0),
se: visuals.rounding.se.at_most(2.0),
};
let rounding = visuals.rounding.at_most(2.0);
ui.painter()
.rect_stroke(rect, rounding, (2.0, visuals.bg_fill)); // fill is intentional, because default style has no border
}