1
0
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:
Emil Ernerfeldt
2021-04-20 10:05:47 +02:00
parent 1681769329
commit 58ebb217dc
3 changed files with 12 additions and 7 deletions

View File

@@ -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.