Skip to content

Commit

Permalink
Fix glyph width computation
Browse files Browse the repository at this point in the history
  • Loading branch information
BoilingTeapot committed Sep 15, 2024
1 parent aa7c502 commit c4e3824
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ std::vector<ProcessedTextGlyph> TextLayoutPlainLine(
ptg.DestRect.X = currentX;
ptg.DestRect.Y = pos.y;
ptg.DestRect.Width =
std::floor((fontSize / font->CellHeight) * font->AdvanceWidths[ptg.CharId]);
std::floor((fontSize / font->BitmapEmWidth) * font->AdvanceWidths[ptg.CharId]);
ptg.DestRect.Height = fontSize;

currentX += ptg.DestRect.Width;
Expand Down

0 comments on commit c4e3824

Please sign in to comment.