Skip to content

Commit

Permalink
Fixed bug in computing width in SpriteFont::MeasureString
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Feb 21, 2016
1 parent 13c371e commit 1c03978
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Src/SpriteFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ XMVECTOR XM_CALLCONV SpriteFont::MeasureString(_In_z_ wchar_t const* text) const

pImpl->ForEachGlyph(text, [&](Glyph const* glyph, float x, float y)
{
float w = (float)(glyph->Subrect.right - glyph->Subrect.left);
float w = (float)(glyph->Subrect.right - glyph->Subrect.left) + glyph->XAdvance;
float h = (float)(glyph->Subrect.bottom - glyph->Subrect.top) + glyph->YOffset;

h = std::max(h, pImpl->lineSpacing);
Expand Down

0 comments on commit 1c03978

Please sign in to comment.