mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
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:
@@ -636,6 +636,7 @@ void CTextBox::refreshText(void)
|
|||||||
if ( m_nMode & SCROLL )
|
if ( m_nMode & SCROLL )
|
||||||
x_center -= SCROLL_FRAME_WIDTH;
|
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);
|
//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,
|
m_pcFontText->RenderString(m_cFrame.iX + m_cFrameTextRel.iX + text_Hborder_width + x_center,
|
||||||
|
Reference in New Issue
Block a user