From f4aa7428ea4c0b62eb3076f5877be9bfea0719b6 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 15 May 2009 14:53:06 +0000 Subject: 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 --- apps/gui/splash.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'apps') 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); } -- cgit v1.2.3