mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
textbox.cpp/h: use parameter as ref, ensure empty string on empty line array
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;
|
||||
}
|
||||
|
@@ -191,7 +191,7 @@ class CTextBox : public sigc::trackable
|
||||
void setTextBorderWidth(int Hborder, int Vborder);
|
||||
void setTextFont(Font* font_text);
|
||||
void setTextMode(const int text_mode){m_nMode = text_mode;};
|
||||
void setTextRenderModeFullBG(bool mode);
|
||||
void setTextRenderModeFullBG(const bool& mode);
|
||||
void setBackGroundColor(CFBWindow::color_t textBackgroundColor){m_textBackgroundColor = textBackgroundColor;};
|
||||
void setWindowPos(const CBox* position){m_cFrame = *position;};
|
||||
void setWindowMaxDimensions(const int width, const int height);
|
||||
|
Reference in New Issue
Block a user