summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-02-16 08:34:56 +0000
committerThomas Martitz <kugel@rockbox.org>2009-02-16 08:34:56 +0000
commit4395c12f4c39cf15e15e37ed518dca4d0f485954 (patch)
tree4bafcd9b972d2d93318a359d5efe3bde643b26c5 /apps
parent54c2f49a69936f7557dc22480edd74c9c8a4ddeb (diff)
Move parts into the if, as they're unused outside of it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20016 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/gwps-common.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 0b5572f09b..0d788769bb 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -482,13 +482,15 @@ static void draw_progressbar(struct gui_wps *gwps,
struct wps_state *state = gwps->state;
struct progressbar *pb = wps_vp->pb;
int y = pb->y;
- int line_height = font_get(wps_vp->vp.font)->height;
- /* center the pb in the line, but only if the line is higher than the pb */
- int center = (line_height-pb->height)/2;
-
- if (y < 0) /* if Y was not set calculate by font height,Y is -line_number-1 */
+ if (y < 0)
+ {
+ int line_height = font_get(wps_vp->vp.font)->height;
+ /* center the pb in the line, but only if the line is higher than the pb */
+ int center = (line_height-pb->height)/2;
+ /* if Y was not set calculate by font height,Y is -line_number-1 */
y = (-y -1)*line_height + (0 > center ? 0 : center);
+ }
if (pb->have_bitmap_pb)
gui_bitmap_scrollbar_draw(display, pb->bm,