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

Refactor: define rect by min/max

This commit is contained in:
Emil Ernerfeldt
2020-04-15 11:47:03 +02:00
parent 7fc2500973
commit 0265b3d43a
3 changed files with 31 additions and 24 deletions

View File

@@ -227,7 +227,7 @@ impl Widget for RadioButton {
center: big_icon_rect.center(),
fill_color: Some(fill_color),
outline: None,
radius: big_icon_rect.size.x / 2.0,
radius: big_icon_rect.size().x / 2.0,
});
if self.checked {
@@ -235,7 +235,7 @@ impl Widget for RadioButton {
center: small_icon_rect.center(),
fill_color: Some(stroke_color),
outline: None,
radius: small_icon_rect.size.x / 2.0,
radius: small_icon_rect.size().x / 2.0,
});
}
@@ -409,7 +409,7 @@ impl<'a> Widget for Slider<'a> {
let rect = interact.rect;
let thickness = rect.size().y;
let thin_size = vec2(rect.size.x, thickness / 5.0);
let thin_size = vec2(rect.size().x, thickness / 5.0);
let thin_rect = Rect::from_center_size(rect.center(), thin_size);
let marker_center_x = remap_clamp(value, min, max, rect.min().x, rect.max().x);