CTextBox: Fix center / right text display

- The x position of the text could assume negative values,
 when the text length was greater than the specified range.


Origin commit data
------------------
Commit: a6487fd951
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-10-16 (Thu, 16 Oct 2014)

Origin message was:
------------------
CTextBox: Fix center / right text display

- The x position of the text could assume negative values,
 when the text length was greater than the specified range.
This commit is contained in:
Michael Liebmann
2014-10-16 14:42:56 +02:00
parent b71cb627f5
commit ac834e963b

View File

@@ -636,6 +636,7 @@ void CTextBox::refreshText(void)
if ( m_nMode & SCROLL )
x_center -= SCROLL_FRAME_WIDTH;
}
x_center = std::max(x_center, 0);
//TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX);
m_pcFontText->RenderString(m_cFrame.iX + m_cFrameTextRel.iX + text_Hborder_width + x_center,