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:
M. Liebmann
2014-10-16 14:42:56 +02:00
parent dc97bbefdf
commit a6487fd951

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,