mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Fix: centered horizontal layouts should never overflow upwards
This commit is contained in:
@@ -287,10 +287,21 @@ impl Rect {
|
||||
self.max.y..=self.min.y
|
||||
}
|
||||
|
||||
#[deprecated = "Use is_negative instead"]
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.max.x < self.min.x || self.max.y < self.min.y
|
||||
}
|
||||
|
||||
/// `max.x < min.x` or `max.y < min.y`.
|
||||
pub fn is_negative(&self) -> bool {
|
||||
self.max.x < self.min.x || self.max.y < self.min.y
|
||||
}
|
||||
|
||||
/// `min.x <= max.x && min.y <= max.y`.
|
||||
pub fn is_non_negative(&self) -> bool {
|
||||
self.min.x <= self.max.x && self.min.y <= self.max.y
|
||||
}
|
||||
|
||||
/// True if all members are also finite.
|
||||
pub fn is_finite(&self) -> bool {
|
||||
self.min.is_finite() && self.max.is_finite()
|
||||
|
||||
Reference in New Issue
Block a user