From 002f41b5bd3da9e327e1dcaf2bfce4906f4b9524 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 10 Jan 2017 23:21:55 +0100 Subject: [PATCH] CTextBox: paint bg always if pixbuffer exists Should prevent unintended possible overlap on multiple font render. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b69803ca4bbba6310ea24bf440365cbeb3c70bb Author: Thilo Graf Date: 2017-01-10 (Tue, 10 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 043ffbaac..79cc95e30 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -601,12 +601,13 @@ void CTextBox::refreshText(void) bool has_changed = hasChanged(&ax, &ay, &dx, &dy); //clean up possible screen on any changes - if (has_changed && m_bgpixbuf){ + if (has_changed || m_bgpixbuf){ /*TODO/FIXME: in some cases could be required, that we must restore old saved screen. eg. if a text without bg was painted * and another text should be painted as next on the same position like current text, but new text will be overpaint and is * not visible. It's currently solvable only with appropriate order of text items */ - frameBuffer->RestoreScreen(m_old_x, m_old_y, m_old_dx, m_old_dy, m_bgpixbuf); + if (m_bgpixbuf) + frameBuffer->RestoreScreen(m_old_x, m_old_y, m_old_dx, m_old_dy, m_bgpixbuf); clearScreenBuffer(); }