From 405ae92f7bd98097a8de75736b067e287d6d448c Mon Sep 17 00:00:00 2001 From: notalpha Date: Tue, 18 Oct 2022 16:40:19 +0200 Subject: [PATCH] fix: Some monospace fonts spacing being non-monospace --- crates/epaint/src/text/text_layout.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/epaint/src/text/text_layout.rs b/crates/epaint/src/text/text_layout.rs index e436db970c1..91a25ab0c39 100644 --- a/crates/epaint/src/text/text_layout.rs +++ b/crates/epaint/src/text/text_layout.rs @@ -122,14 +122,13 @@ fn layout_section( paragraph.glyphs.push(Glyph { chr, - pos: pos2(paragraph.cursor_x, f32::NAN), + pos: pos2(font.round_to_pixel(paragraph.cursor_x), f32::NAN), size: vec2(glyph_info.advance_width, font_height), uv_rect: glyph_info.uv_rect, section_index, }); paragraph.cursor_x += glyph_info.advance_width; - paragraph.cursor_x = font.round_to_pixel(paragraph.cursor_x); last_glyph_id = Some(glyph_info.id); } }