From e4e1638fc007aaa54ea4ab30ea1743c8dc3df85f Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 19 Dec 2022 11:31:27 +0100 Subject: [PATCH] Fix newly introduced rendering bug for thin rectangles --- crates/epaint/src/tessellator.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/epaint/src/tessellator.rs b/crates/epaint/src/tessellator.rs index fd4b2edd..062d18ae 100644 --- a/crates/epaint/src/tessellator.rs +++ b/crates/epaint/src/tessellator.rs @@ -1316,16 +1316,18 @@ impl Tessellator { self.tessellate_line(line, Stroke::new(rect.width(), fill), out); } if !stroke.is_empty() { - self.tessellate_line(line, stroke, out); + self.tessellate_line(line, stroke, out); // back… + self.tessellate_line(line, stroke, out); // …and forth } } else if rect.height() < self.feathering { // Very thin - approximate by a horizontal line-segment: let line = [rect.left_center(), rect.right_center()]; if fill != Color32::TRANSPARENT { - self.tessellate_line(line, Stroke::new(rect.width(), fill), out); + self.tessellate_line(line, Stroke::new(rect.height(), fill), out); } if !stroke.is_empty() { - self.tessellate_line(line, stroke, out); + self.tessellate_line(line, stroke, out); // back… + self.tessellate_line(line, stroke, out); // …and forth } } else { let path = &mut self.scratchpad_path;