From b79503d43bf4033411d956f9ab531157e05c7f48 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 9 Nov 2023 11:17:20 +0100 Subject: [PATCH] Fix visual artifact with thin rounded rectangles --- crates/egui_demo_lib/src/demo/misc_demo_window.rs | 2 +- crates/epaint/src/tessellator.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/egui_demo_lib/src/demo/misc_demo_window.rs b/crates/egui_demo_lib/src/demo/misc_demo_window.rs index 195b79e223a..a90465cc19d 100644 --- a/crates/egui_demo_lib/src/demo/misc_demo_window.rs +++ b/crates/egui_demo_lib/src/demo/misc_demo_window.rs @@ -371,7 +371,7 @@ impl BoxPainting { ui.painter().rect( rect, self.rounding, - Color32::from_gray(64), + ui.visuals().text_color().gamma_multiply(0.5), Stroke::new(self.stroke_width, Color32::WHITE), ); } diff --git a/crates/epaint/src/tessellator.rs b/crates/epaint/src/tessellator.rs index 49cbd31198f..9771362ba37 100644 --- a/crates/epaint/src/tessellator.rs +++ b/crates/epaint/src/tessellator.rs @@ -535,6 +535,7 @@ pub mod path { add_circle_quadrant(path, pos2(min.x + r.sw, max.y - r.sw), r.sw, 1.0); add_circle_quadrant(path, pos2(min.x + r.nw, min.y + r.nw), r.nw, 2.0); add_circle_quadrant(path, pos2(max.x - r.ne, min.y + r.ne), r.ne, 3.0); + path.dedup(); // We get duplicates for thin rectangles, producing visual artifats } }