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)


Origin commit data
------------------
Branch: ni/coolstream
Commit: b04ab099b2
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-07-18 (Wed, 18 Jul 2012)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2012-07-18 21:01:34 +02:00
parent 69937ae8fd
commit 2da175a159

View File

@@ -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;