Cleanup, we should not have two text boxes and be moving stuff around between them in order to limit the number of lines

This commit is contained in:
Charles Lohr
2005-05-04 05:34:28 +00:00
parent 326a03ff79
commit 9a92b7222f
2 changed files with 19 additions and 0 deletions
+18
View File
@@ -583,6 +583,24 @@ bool BitmapText::StringWillUseAlternate( const CString& sText, const CString& sA
return true;
}
void BitmapText::SetMaxLines( int iNumLines, int iDirection )
{
iNumLines = MAX( 0, iNumLines );
iNumLines = MIN( m_wTextLines.size(), iNumLines );
if ( iDirection == 0 )
{
//Crop all bottom lines
m_wTextLines.resize( iNumLines );
m_iLineWidths.resize( iNumLines );
}
else
{
m_wTextLines.erase( m_wTextLines.begin(), m_wTextLines.end() - iNumLines );
m_iLineWidths.erase( m_iLineWidths.begin(), m_iLineWidths.end() - iNumLines );
}
BuildChars();
}
void BitmapText::CropToWidth( int iMaxWidthInSourcePixels )
{
iMaxWidthInSourcePixels = max( 0, iMaxWidthInSourcePixels );