mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -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.
|
/// Bounding-box around the points.
|
||||||
pub fn from_points(points: &[Pos2]) -> Self {
|
pub fn from_points(points: &[Pos2]) -> Self {
|
||||||
let mut rect = Self::NOTHING;
|
let mut rect = Self::NOTHING;
|
||||||
|
|||||||
Reference in New Issue
Block a user