From 1a96d3704dcc05caf9e68ccabb7cd7bf60fef361 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Sun, 1 Dec 2024 07:57:03 -0800 Subject: [PATCH] Fixing text metrics --- CHANGELOG.md | 2 ++ src/text.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ada2e45..0f5f29488 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 to ensure proper subpixel alignment. - Plotters integration text drawing now honors anchor positioning, rotation, and properly sets the line height based. +- `MeasuredText`'s metrics are now more accurate. The wrong value for the + baseline was being used, leading to slightly incorrect measurements. ## v0.11.0 (2024-09-14) diff --git a/src/text.rs b/src/text.rs index 666b493fa..ce323ba6b 100644 --- a/src/text.rs +++ b/src/text.rs @@ -550,7 +550,7 @@ pub(crate) fn map_each_glyph( blit, glyph, (run.line_top / metrics.line_height).round().cast::(), - relative_to.y, + Px::from(run.line_y), Px::from(run.line_w.ceil()), kludgine, );