CTextBox: don't paint full background if max text width smaller than bg width

This commit is contained in:
2016-02-10 21:20:21 +01:00
parent 65fe634e85
commit 342de45cc3

View File

@@ -563,7 +563,7 @@ void CTextBox::refreshText(void)
//bg variables //bg variables
int ax = m_cFrameTextRel.iX+m_cFrame.iX; int ax = m_cFrameTextRel.iX+m_cFrame.iX;
int ay = m_cFrameTextRel.iY+m_cFrame.iY; int ay = m_cFrameTextRel.iY+m_cFrame.iY;
int dx = m_cFrameTextRel.iWidth; int dx = m_old_cText != m_cText ? m_cFrameTextRel.iWidth : m_nMaxTextWidth;
int dy = m_cFrameTextRel.iHeight; int dy = m_cFrameTextRel.iHeight;
//find changes //find changes
@@ -602,7 +602,8 @@ void CTextBox::refreshText(void)
clearScreenBuffer(); clearScreenBuffer();
if (allow_paint_bg){ if (allow_paint_bg){
//TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__);
frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); //paint full background only on new text, otherwise paint required background
frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType);
} }
} }
else{ else{