mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
CTextBox: fix text position calculation
Origin commit data
------------------
Branch: ni/coolstream
Commit: a85878db2f
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2015-02-01 (Sun, 01 Feb 2015)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
committed by
Jacek Jendrzej
parent
92a9684e02
commit
f9031070d5
@@ -613,17 +613,19 @@ void CTextBox::refreshText(void)
|
||||
int i;
|
||||
int x_center = 0;
|
||||
|
||||
int lines = std::min(m_nLinesPerPage, m_nNrOfLines);
|
||||
|
||||
// set text y position
|
||||
if (m_nMode & TOP)
|
||||
// move to top of frame
|
||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1);
|
||||
else if (m_nMode & BOTTOM)
|
||||
// move to bottom of frame
|
||||
y += m_cFrameTextRel.iHeight - (m_nNrOfLines > 1 ? (m_nNrOfLines-1)*m_nFontTextHeight : 0) - text_Vborder_width;
|
||||
y += m_cFrameTextRel.iHeight - (lines > 1 ? (lines - 1)*m_nFontTextHeight : 0) - text_Vborder_width;
|
||||
//m_nFontTextHeight + text_Vborder_width /*- ((m_cFrameTextRel.iHeight + m_nFontTextHeight*/ * m_nLinesPerPage/*) >> 1)*/;
|
||||
else
|
||||
// fit into mid of frame space
|
||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1);
|
||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * lines) >> 1);
|
||||
|
||||
for(i = m_nCurrentLine; i < m_nNrOfLines && i < m_nCurrentLine + m_nLinesPerPage; i++)
|
||||
{
|
||||
|
Reference in New Issue
Block a user