From d295caa7267ecc5be6dca83c5d1254fdc0c81b19 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 16 Dec 2024 16:23:41 +0100 Subject: [PATCH] Round to pixel cente --- crates/epaint/src/tessellator.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/epaint/src/tessellator.rs b/crates/epaint/src/tessellator.rs index a0ac697cb69..0594c8a2aa2 100644 --- a/crates/epaint/src/tessellator.rs +++ b/crates/epaint/src/tessellator.rs @@ -1713,11 +1713,9 @@ impl Tessellator { // TODO(#5164): maybe do this for all shapes and stroke sizes // TODO(emilk): since we use StrokeKind::Outside, we should probably round the // corners after offsetting them with half the stroke width (see `translate_stroke_point`). - // The current code can create an effect where the top and left edges are thicker than the bottom and right edges, - // but at least they won't alias when translated. Rect { - min: self.round_pos_to_pixel(rect.min), - max: self.round_pos_to_pixel(rect.max), + min: self.round_pos_to_pixel_center(rect.min), + max: self.round_pos_to_pixel_center(rect.max), } } else { rect