From b04ab099b22c28dd25d786c1af6b9c1d745acbc7 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 18 Jul 2012 21:01:34 +0200 Subject: [PATCH] hintboxext: fix for too long lines text offset was calculated wrong if lines too long to fit on the screen were present, leading to all sorts of graphics corruptions (e.g. visible with the simple test.sh script from tuxbox wiki) --- src/gui/widget/hintboxext.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp index da24aece3..da3c7e344 100644 --- a/src/gui/widget/hintboxext.cpp +++ b/src/gui/widget/hintboxext.cpp @@ -191,6 +191,13 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const int Width, const c if (nw > m_width) m_width = nw; + + /* if the output does not fit, make sure we at least + * stay inside the screen... */ + m_width = w_max(m_width ,SHADOW_OFFSET); + if (maxLineWidth + scrollWidth > m_width) + maxLineWidth = m_width - scrollWidth; + textStartX = (m_width - scrollWidth - maxLineWidth) / 2; m_window = NULL;