From e6fe6a6f6ad7c1746b47e45658c693fde9a33792 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 28 May 2021 19:51:10 +0200 Subject: [PATCH] Fix occasional jittery vertical positioning of glyphs --- epaint/src/text/font.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epaint/src/text/font.rs b/epaint/src/text/font.rs index af648b88..7f7e9cc2 100644 --- a/epaint/src/text/font.rs +++ b/epaint/src/text/font.rs @@ -92,6 +92,9 @@ impl FontImpl { // let height_in_pixels = v.ascent - v.descent + v.line_gap; // let height_in_points = height_in_pixels / pixels_per_point; + // Round to closest pixel: + let y_offset = (y_offset * pixels_per_point).round() / pixels_per_point; + Self { rusttype_font, scale_in_pixels,