mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
CTextBox: ensure paint of background to avoid overlapped letters
This commit is contained in:
@@ -135,13 +135,14 @@ CTextBox::~CTextBox()
|
|||||||
//TRACE("[CTextBox] del\r\n");
|
//TRACE("[CTextBox] del\r\n");
|
||||||
m_cLineArray.clear();
|
m_cLineArray.clear();
|
||||||
hide();
|
hide();
|
||||||
|
delete[] m_bgpixbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTextBox::initVar(void)
|
void CTextBox::initVar(void)
|
||||||
{
|
{
|
||||||
//TRACE("[CTextBox]->InitVar\r\n");
|
//TRACE("[CTextBox]->InitVar\r\n");
|
||||||
frameBuffer = NULL;
|
frameBuffer = NULL;
|
||||||
|
m_bgpixbuf = NULL;
|
||||||
|
|
||||||
m_showTextFrame = 0;
|
m_showTextFrame = 0;
|
||||||
m_nNrOfNewLine = 0;
|
m_nNrOfNewLine = 0;
|
||||||
@@ -510,10 +511,27 @@ void CTextBox::refreshText(void)
|
|||||||
|
|
||||||
//TRACE("[CTextBox] m_nCurrentLine: %d, m_nNrOfLines %d, m_cLineArray[m_nCurrentLine]: %s\r\n",m_nCurrentLine, m_nNrOfLines, m_cLineArray[m_nCurrentLine].c_str());
|
//TRACE("[CTextBox] m_nCurrentLine: %d, m_nNrOfLines %d, m_cLineArray[m_nCurrentLine]: %s\r\n",m_nCurrentLine, m_nNrOfLines, m_cLineArray[m_nCurrentLine].c_str());
|
||||||
|
|
||||||
|
//bg variables
|
||||||
|
int ax = m_cFrameTextRel.iX+m_cFrame.iX;
|
||||||
|
int ay = /*m_cFrameTextRel.iY+*/m_cFrame.iY;
|
||||||
|
int dx = m_cFrameTextRel.iWidth;
|
||||||
|
int dy = m_cFrameTextRel.iHeight;
|
||||||
|
|
||||||
|
//save screen
|
||||||
|
if (m_bgpixbuf == NULL){
|
||||||
|
m_bgpixbuf= new fb_pixel_t[dx * dy];
|
||||||
|
frameBuffer->SaveScreen(ax, ay, dx, dy, m_bgpixbuf);
|
||||||
|
}
|
||||||
|
|
||||||
//Paint Text Background
|
//Paint Text Background
|
||||||
if (m_nPaintBackground)
|
if (m_nPaintBackground){
|
||||||
frameBuffer->paintBoxRel(m_cFrameTextRel.iX+m_cFrame.iX, /*m_cFrameTextRel.iY+*/m_cFrame.iY,
|
if (m_bgpixbuf)
|
||||||
m_cFrameTextRel.iWidth, m_cFrameTextRel.iHeight, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType);
|
delete[] m_bgpixbuf;
|
||||||
|
m_bgpixbuf = NULL;
|
||||||
|
frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
frameBuffer->RestoreScreen(ax, ay, dx, dy, m_bgpixbuf);
|
||||||
|
|
||||||
if( m_nNrOfLines <= 0)
|
if( m_nNrOfLines <= 0)
|
||||||
return;
|
return;
|
||||||
|
@@ -150,6 +150,7 @@ class CTextBox
|
|||||||
int m_nFontTextHeight;
|
int m_nFontTextHeight;
|
||||||
CFBWindow::color_t m_textBackgroundColor;
|
CFBWindow::color_t m_textBackgroundColor;
|
||||||
fb_pixel_t m_textColor;
|
fb_pixel_t m_textColor;
|
||||||
|
fb_pixel_t* m_bgpixbuf;
|
||||||
|
|
||||||
CFrameBuffer * frameBuffer;
|
CFrameBuffer * frameBuffer;
|
||||||
/* int max_width;*/
|
/* int max_width;*/
|
||||||
|
Reference in New Issue
Block a user