Skip to content

Commit

Permalink
apply scale to TextLayout height
Browse files Browse the repository at this point in the history
  • Loading branch information
micahrj committed Jan 3, 2025
1 parent 6b25d1b commit 7aeff04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ impl TextLayout {
offset += scale * glyph_pos.x_advance as f32;
}

let height = scale * (font.face.ascender() - font.face.descender()) as f32;

TextLayout {
width: offset,
height: (font.face.ascender() - font.face.descender()) as f32,
height,
glyphs,
}
}
Expand Down

0 comments on commit 7aeff04

Please sign in to comment.