From 852993654d4b29ba36282500b3c9085a40da0fff Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 6 Jun 2016 19:25:34 -0700 Subject: [PATCH] Tighten up MeasureDrawBounds Y extents --- Src/SpriteFont.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Src/SpriteFont.cpp b/Src/SpriteFont.cpp index b1b3d69e1..7aee72591 100644 --- a/Src/SpriteFont.cpp +++ b/Src/SpriteFont.cpp @@ -366,12 +366,10 @@ RECT SpriteFont::MeasureDrawBounds(_In_z_ wchar_t const* text, XMFLOAT2 const& p pImpl->ForEachGlyph(text, [&](Glyph const* glyph, float x, float y, float advance) { float w = (float)(glyph->Subrect.right - glyph->Subrect.left); - float h = (float)(glyph->Subrect.bottom - glyph->Subrect.top) + glyph->YOffset; - - h = std::max(h, pImpl->lineSpacing); + float h = (float)(glyph->Subrect.bottom - glyph->Subrect.top); - float minX = (position.x + x); - float minY = (position.y + y); + float minX = position.x + x; + float minY = position.y + y + glyph->YOffset; float maxX = std::max(minX + advance, minX + w); float maxY = minY + h;