mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-08 06:08:29 +02:00
textbox.cpp/h: use parameter as ref, ensure empty string on empty line array
Origin commit data
------------------
Commit: 1d97e5f0b8
Author: Thilo Graf <dbt@novatux.de>
Date: 2019-04-11 (Thu, 11 Apr 2019)
This commit is contained in:
@@ -707,7 +707,8 @@ void CTextBox::refreshText(void)
|
||||
//calculate xpos
|
||||
if ((m_nMode & CENTER) || (m_nMode & RIGHT))
|
||||
{
|
||||
x_center = m_cFrameTextRel.iWidth - m_cFrameTextRel.iX - 2*text_Hborder_width - m_pcFontText->getRenderWidth(m_cLineArray[i], m_utf8_encoded);
|
||||
std::string tmpline = !m_cLineArray.empty() ? m_cLineArray[i] : "";
|
||||
x_center = m_cFrameTextRel.iWidth - m_cFrameTextRel.iX - 2*text_Hborder_width - m_pcFontText->getRenderWidth(tmpline, m_utf8_encoded);
|
||||
if (m_nMode & CENTER)
|
||||
x_center /= 2;
|
||||
if (m_nMode & SCROLL)
|
||||
@@ -947,7 +948,7 @@ void CTextBox::disableBackgroundPaint()
|
||||
enableBackgroundPaint(false);
|
||||
}
|
||||
|
||||
void CTextBox::setTextRenderModeFullBG(bool mode)
|
||||
void CTextBox::setTextRenderModeFullBG(const bool& mode)
|
||||
{
|
||||
m_renderMode = (mode) ? 2 /*Font::FULLBG*/ : 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user