From cc709053361c86a7f31b411de1cbf88cfaa82620 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 10 May 2020 13:06:43 +0200 Subject: [PATCH] Support painting infinitely sized rectangles --- emigui/src/mesher.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emigui/src/mesher.rs b/emigui/src/mesher.rs index fe98215d..87ad3af0 100644 --- a/emigui/src/mesher.rs +++ b/emigui/src/mesher.rs @@ -455,8 +455,12 @@ pub fn mesh_command(options: MesherOptions, fonts: &Fonts, command: PaintCmd, ou corner_radius, fill_color, outline, - rect, + mut rect, } => { + // Common bug is to accidentally create an infinitely sized ractangle. + // Make sure we can visualize that: + rect.max = rect.max.min(pos2(1e7, 1e7)); + let mut path = Path::default(); path.add_rounded_rectangle(rect, corner_radius); if let Some(fill_color) = fill_color {