From 20fd425c49d1a4e0a221737f303cb4882eaec7f7 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 4 Feb 2025 15:01:46 +0100 Subject: [PATCH] Make the ends of vline/hline sharper --- crates/epaint/src/tessellator.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/epaint/src/tessellator.rs b/crates/epaint/src/tessellator.rs index 0e2dd4c8e..d7446ddfc 100644 --- a/crates/epaint/src/tessellator.rs +++ b/crates/epaint/src/tessellator.rs @@ -1644,6 +1644,9 @@ impl Tessellator { round_line_segment(&mut x, &stroke, self.pixels_per_point); a.x = x; b.x = x; + + a.y = a.y.round_to_pixel_center(self.pixels_per_point); + b.y = b.y.round_to_pixel_center(self.pixels_per_point); } if a.y == b.y { // Horizontal line @@ -1651,6 +1654,9 @@ impl Tessellator { round_line_segment(&mut y, &stroke, self.pixels_per_point); a.y = y; b.y = y; + + a.x = a.x.round_to_pixel_center(self.pixels_per_point); + b.x = b.x.round_to_pixel_center(self.pixels_per_point); } }