mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 12:50:04 -04:00
Fix left alignment of widgets and tweak style slightly
This commit is contained in:
@@ -343,16 +343,21 @@ impl Rect {
|
||||
}
|
||||
}
|
||||
|
||||
// keep min
|
||||
/// keep min
|
||||
pub fn set_width(&mut self, w: f32) {
|
||||
self.max.x = self.min.x + w;
|
||||
}
|
||||
|
||||
// keep min
|
||||
/// keep min
|
||||
pub fn set_height(&mut self, h: f32) {
|
||||
self.max.y = self.min.y + h;
|
||||
}
|
||||
|
||||
/// Keep size
|
||||
pub fn set_center(&mut self, center: Pos2) {
|
||||
*self = self.translate(center - self.center());
|
||||
}
|
||||
|
||||
pub fn contains(&self, p: Pos2) -> bool {
|
||||
self.min.x <= p.x
|
||||
&& p.x <= self.min.x + self.size().x
|
||||
|
||||
Reference in New Issue
Block a user