mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Refactor Region: remember region rectangle
This will be used as a clip rectangle for generated paint commands.
This commit is contained in:
@@ -272,6 +272,16 @@ impl Rect {
|
||||
Rect::from_min_size(self.min() + amnt, self.size())
|
||||
}
|
||||
|
||||
// keep min
|
||||
pub fn set_width(&mut self, w: f32) {
|
||||
self.max.x = self.min.x + w;
|
||||
}
|
||||
|
||||
// keep min
|
||||
pub fn set_height(&mut self, h: f32) {
|
||||
self.max.y = self.min.y + h;
|
||||
}
|
||||
|
||||
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