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

A simple 2D plot library

This commit is contained in:
Emil Ernerfeldt
2021-02-14 21:39:04 +01:00
parent 7dad76b913
commit a19140ec67
14 changed files with 1039 additions and 11 deletions

View File

@@ -180,6 +180,18 @@ impl Rect {
self.max = self.max.max(p);
}
/// Expand to include the given x coordinate
pub fn extend_with_x(&mut self, x: f32) {
self.min.x = self.min.x.min(x);
self.max.x = self.max.x.max(x);
}
/// Expand to include the given y coordinate
pub fn extend_with_y(&mut self, y: f32) {
self.min.y = self.min.y.min(y);
self.max.y = self.max.y.max(y);
}
pub fn union(self, other: Rect) -> Rect {
Rect {
min: self.min.min(other.min),