* grub-core/gfxmenu/gui_circular_progress.c: Take both width and height

into account when calculating radius.
This commit is contained in:
Vladimir Testov 2013-04-03 09:20:29 +02:00 committed by Vladimir 'phcoder' Serbinenko
parent 9efd73ec66
commit c3578acfbb
3 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-04-03 Vladimir Testov <vladimir.testov@rosalab.ru>
2013-04-03 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/gfxmenu/gui_circular_progress.c: Take both width and height
into account when calculating radius.
2013-04-03 Vladimir Testov <vladimir.testov@rosalab.ru>
* grub-core/gfxmenu/view.c: Fix off-by-one error.

View File

@ -138,7 +138,7 @@ circprog_paint (void *vself, const grub_video_rect_t *region)
(height - center_height) / 2, 0, 0,
center_width, center_height);
int radius = width / 2 - tick_width / 2 - 1;
int radius = grub_min (height, width) / 2 - grub_max (tick_height, tick_width) / 2 - 1;
int nticks;
int tick_begin;
int tick_end;

View File

@ -478,4 +478,7 @@ void EXPORT_FUNC(grub_real_boot_time) (const char *file,
#define grub_boot_time(fmt, args...)
#endif
#define grub_max(a, b) (((a) > (b)) ? (a) : (b))
#define grub_min(a, b) (((a) < (b)) ? (a) : (b))
#endif /* ! GRUB_MISC_HEADER */