mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 12:50:04 -04:00
Tesselator: ignore zero-sized clip rects
Improves https://github.com/emilk/egui/issues/328
This commit is contained in:
@@ -297,16 +297,21 @@ impl Rect {
|
||||
self.max.x < self.min.x || self.max.y < self.min.y
|
||||
}
|
||||
|
||||
/// `max.x < min.x` or `max.y < min.y`.
|
||||
/// `width < 0 || height < 0`
|
||||
#[inline(always)]
|
||||
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`.
|
||||
#[inline(always)]
|
||||
#[deprecated = "Use !is_negative() instead"]
|
||||
pub fn is_non_negative(&self) -> bool {
|
||||
self.min.x <= self.max.x && self.min.y <= self.max.y
|
||||
!self.is_negative()
|
||||
}
|
||||
|
||||
/// `width > 0 && height > 0`
|
||||
#[inline(always)]
|
||||
pub fn is_positive(&self) -> bool {
|
||||
self.min.x < self.max.x && self.min.y < self.max.y
|
||||
}
|
||||
|
||||
/// True if all members are also finite.
|
||||
|
||||
Reference in New Issue
Block a user