From b1f6b1751cffd98a5217cc9bbbbef4f3fa241b5e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 24 Nov 2003 02:31:41 +0000 Subject: [PATCH] set m_size --- stepmania/src/BitmapText.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index ccdc0bf2af..9598ac4c83 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -138,6 +138,7 @@ void BitmapText::BuildChars() m_iLineWidths.push_back(m_pFont->GetLineWidthInSourcePixels( m_wTextLines[l] )); m_iWidestLineWidth = max(m_iWidestLineWidth, m_iLineWidths.back()); } + m_size.x = (float) m_iWidestLineWidth; verts.clear(); @@ -145,7 +146,7 @@ void BitmapText::BuildChars() if(m_wTextLines.empty()) return; - int TotalHeight = m_pFont->GetHeight() * m_wTextLines.size(); + m_size.y = float(m_pFont->GetHeight() * m_wTextLines.size()); unsigned i; int MinSpacing = 0; @@ -153,14 +154,14 @@ void BitmapText::BuildChars() int Padding = max(m_pFont->GetLineSpacing(), MinSpacing) - m_pFont->GetHeight(); /* There's padding between every line: */ - TotalHeight += Padding * (m_wTextLines.size()-1); + m_size.y += Padding * (m_wTextLines.size()-1); int iY; // the top position of the first row of characters switch( m_VertAlign ) { case align_top: iY = 0; break; - case align_middle: iY = -(int)roundf(TotalHeight/2.0f); break; - case align_bottom: iY = -TotalHeight; break; + case align_middle: iY = -(int)roundf(m_size.y/2.0f); break; + case align_bottom: iY = -(int)m_size.y; break; default: ASSERT( false ); return; }