From 5f01b0dc9d2d4e029fd7bfba9a38df7e14ddf5d4 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 30 Mar 2025 17:52:29 +0200 Subject: [PATCH] Round glyph to closes pixel --- crates/epaint/src/text/text_layout.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/epaint/src/text/text_layout.rs b/crates/epaint/src/text/text_layout.rs index 1012fbd84..10e078ebb 100644 --- a/crates/epaint/src/text/text_layout.rs +++ b/crates/epaint/src/text/text_layout.rs @@ -634,6 +634,8 @@ fn galley_from_rows( // When mixing different `FontImpl` (e.g. latin and emojis), // we always center the difference: + 0.5 * (glyph.font_height - glyph.font_impl_height); + + glyph.pos.y = point_scale.round_to_pixel(glyph.pos.y); } placed_row.pos.y = cursor_y;