From 4395c12f4c39cf15e15e37ed518dca4d0f485954 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 16 Feb 2009 08:34:56 +0000 Subject: [PATCH] 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 --- apps/gui/gwps-common.c | 12 +++++++----- 1 file 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,