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
+2 -2
View File
@@ -333,7 +333,7 @@ impl Layout {
impl Layout {
pub fn align_size_within_rect(&self, size: Vec2, outer: Rect) -> Rect {
debug_assert!(size.x >= 0.0 && size.y >= 0.0);
debug_assert!(outer.is_non_negative());
debug_assert!(!outer.is_negative());
self.align2().align_size_within_rect(size, outer)
}
@@ -571,7 +571,7 @@ impl Layout {
/// Apply justify (fill width/height) and/or alignment after calling `next_space`.
pub(crate) fn justify_and_align(&self, frame: Rect, mut child_size: Vec2) -> Rect {
debug_assert!(child_size.x >= 0.0 && child_size.y >= 0.0);
debug_assert!(frame.is_non_negative());
debug_assert!(!frame.is_negative());
if self.horizontal_justify() {
child_size.x = child_size.x.at_least(frame.width()); // fill full width