summaryrefslogtreecommitdiff
path: root/apps/plugins/clock/clock_draw_digital.c
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2008-06-28 20:45:21 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2008-06-28 20:45:21 +0000
commit205f3df7816a1eea9c812ea285d74a4f8ecfad2a (patch)
tree356be7b807a4407b7e243ec57da4d5068fe09ab1 /apps/plugins/clock/clock_draw_digital.c
parent3d240f1e2a34e616c2aba22b58ea78de7f277127 (diff)
Remove a viewport ambiguity by changing the screens width/heigth members into lcdwidth/lcdheight. Normal usercode should always use getwidth()/getheigth() as that returns the viewport width/height. Fixes issues that would have appeared in many places when introducing viewports with sizes != lcd sizes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17857 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/clock/clock_draw_digital.c')
-rw-r--r--apps/plugins/clock/clock_draw_digital.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/plugins/clock/clock_draw_digital.c b/apps/plugins/clock/clock_draw_digital.c
index d5c37ad8dc..7c5925d75f 100644
--- a/apps/plugins/clock/clock_draw_digital.c
+++ b/apps/plugins/clock/clock_draw_digital.c
@@ -64,19 +64,22 @@ void digital_clock_draw(struct screen* display,
}
}
getstringsize(digits_bitmaps, buffer, &str_w, &str_h);
- draw_string(display, digits_bitmaps, buffer, (display->width-str_w)/2, 0);
+ draw_string(display, digits_bitmaps, buffer,
+ (display->getwidth()-str_w)/2, 0);
if(settings->digital.show_seconds){
buffer_pos=0;
buffer_printf(buffer, buffer_pos, "%02d", time->second);
getstringsize(digits_bitmaps, buffer, &str_w, &str_h);
- draw_string(display, digits_bitmaps, buffer, (display->width-str_w)/2,
+ draw_string(display, digits_bitmaps, buffer,
+ (display->getwidth()-str_w)/2,
digits_bitmaps->height);
}
if(settings->general.date_format!=NONE){
format_date(buffer, time, settings->general.date_format);
getstringsize(smalldigits_bitmaps, buffer, &str_w, &str_h);
- draw_string(display, smalldigits_bitmaps, buffer, (display->width-str_w)/2,
- display->height-smalldigits_bitmaps->height*2);
+ draw_string(display, smalldigits_bitmaps, buffer,
+ (display->getwidth()-str_w)/2,
+ display->getheight()-smalldigits_bitmaps->height*2);
}
if(counter){
struct time counter_time;
@@ -84,7 +87,7 @@ void digital_clock_draw(struct screen* display,
rb->snprintf(buffer, 20, "%02d:%02d:%02d",
counter_time.hour, counter_time.minute, counter_time.second);
getstringsize(smalldigits_bitmaps, buffer, &str_w, &str_h);
- draw_string(display, smalldigits_bitmaps, buffer, (display->width-str_w)/2,
- display->height-str_h);
+ draw_string(display, smalldigits_bitmaps, buffer,
+ (display->getwidth()-str_w)/2, display->getheight()-str_h);
}
}