diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-05-15 14:53:06 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-05-15 14:53:06 +0000 |
commit | f4aa7428ea4c0b62eb3076f5877be9bfea0719b6 (patch) | |
tree | 49954545de5bb71676273919cf7228ffc63c054d /apps/gui/splash.c | |
parent | d8c7285b2aef85c9998c6558429a9f4e27066748 (diff) | |
download | rockbox-f4aa7428ea4c0b62eb3076f5877be9bfea0719b6.tar.gz rockbox-f4aa7428ea4c0b62eb3076f5877be9bfea0719b6.zip |
Fix FS#10197 by setting the viewport before calculating the string size.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20943 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/splash.c')
-rw-r--r-- | apps/gui/splash.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/gui/splash.c b/apps/gui/splash.c index 69691793a8..5b3710f140 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c @@ -61,6 +61,9 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) struct viewport vp; int maxw = 0; + viewport_set_defaults(&vp, screen->screen_type); + screen->set_viewport(&vp); + screen->getstringsize(" ", &space_w, &h); #else /* HAVE_LCD_CHARCELLS */ @@ -76,7 +79,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) next = strtok_r(splash_buf, " ", &store); if (!next) - return; /* nothing to display */ + goto end; /* nothing to display */ lines[0] = next; while (true) @@ -130,7 +133,6 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) screen->stop_scroll(); #ifdef HAVE_LCD_BITMAP - viewport_set_defaults(&vp, screen->screen_type); /* If we center the display, then just clear the box we need and put a nice little frame and put the text in there! */ vp.y = (screen->lcdheight - y) / 2 - RECT_SPACING; /* height => y start position */ @@ -157,7 +159,6 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) #endif vp.drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); - screen->set_viewport(&vp); screen->fillrect(0, 0, vp.width, vp.height); #if LCD_DEPTH > 1 @@ -196,6 +197,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) #undef W } screen->update_viewport(); +end: screen->set_viewport(NULL); } |