From 2dd2fac37609c190c01312b919d58321c08d519d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 Feb 2016 21:20:21 +0100 Subject: [PATCH] CTextBox: don't paint full background if max text width smaller than bg width --- src/gui/widget/textbox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index e2daec4bd..0fc38b141 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -563,7 +563,7 @@ void CTextBox::refreshText(void) //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; 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; //find changes @@ -602,6 +602,7 @@ void CTextBox::refreshText(void) clearScreenBuffer(); if (allow_paint_bg){ //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); + //paint full background only on new text, otherwise paint required background frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); } }