mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +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.
Origin commit data
------------------
Commit: c9472dc3f3
Author: Thilo Graf <dbt@novatux.de>
Date: 2012-09-22 (Sat, 22 Sep 2012)
Origin message was:
------------------
*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;
|
||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 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