From 17691abd05a7d6537407026fc29ce89cc209c19f Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 28 Mar 2007 16:25:41 +0000 Subject: [PATCH] psplash: Draw the progress bar more optimally --- psplash.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/psplash.c b/psplash.c index bef38a6..2a7ae38 100644 --- a/psplash.c +++ b/psplash.c @@ -70,19 +70,21 @@ psplash_draw_progress (PSplashFB *fb, int value) width = BAR_IMG_WIDTH - 8; height = BAR_IMG_HEIGHT - 8; - /* clear */ - psplash_fb_draw_rect (fb, x, y, width, height, - 0xec, 0xec, 0xe1); - if (value > 0) { barwidth = (CLAMP(value,0,100) * width) / 100; + psplash_fb_draw_rect (fb, x + barwidth, y, + width - barwidth, height, + 0xec, 0xec, 0xe1); psplash_fb_draw_rect (fb, x, y, barwidth, height, 0x6d, 0x6d, 0x70); } else { barwidth = (CLAMP(-value,0,100) * width) / 100; + psplash_fb_draw_rect (fb, x, y, + width - barwidth, height, + 0xec, 0xec, 0xe1); psplash_fb_draw_rect (fb, x + width - barwidth, y, barwidth, height, 0x6d, 0x6d, 0x70); -- 2.7.4