mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
*CTextBox: set text y position depends of lines count
If we have only one line, text will be painted horizontal centered, otherwise text begins on top of frame.
This commit is contained in:
@@ -506,8 +506,14 @@ void CTextBox::refreshText(void)
|
||||
int i;
|
||||
int x_center = 0;
|
||||
|
||||
// y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1) - text_border_width;
|
||||
// set text y position depends of lines count
|
||||
if (m_nNrOfLines > 1)
|
||||
// move to top of frame
|
||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1) - text_border_width;
|
||||
else
|
||||
// fit into mid of frame space
|
||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1) - text_border_width;
|
||||
|
||||
for(i = m_nCurrentLine; i < m_nNrOfLines && i < m_nCurrentLine + m_nLinesPerPage; i++)
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user