mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Add Rect::from_pos
This commit is contained in:
@@ -110,6 +110,15 @@ impl Rect {
|
||||
}
|
||||
}
|
||||
|
||||
/// A zero-sized rect at a specific point.
|
||||
#[inline]
|
||||
pub fn from_pos(point: Pos2) -> Self {
|
||||
Self {
|
||||
min: point,
|
||||
max: point,
|
||||
}
|
||||
}
|
||||
|
||||
/// Bounding-box around the points.
|
||||
pub fn from_points(points: &[Pos2]) -> Self {
|
||||
let mut rect = Self::NOTHING;
|
||||
|
||||
Reference in New Issue
Block a user