grub2/0242-grub-core-gfxmenu-gui_circular_progress.c-Take-both-.patch
2013-05-02 16:54:52 -04:00

56 lines
1.9 KiB
Diff

From a2575f0e5de45c022ed54a5b368e82b2a688c73e Mon Sep 17 00:00:00 2001
From: Vladimir Testov <vladimir.testov@rosalab.ru>
Date: Wed, 3 Apr 2013 09:20:29 +0200
Subject: [PATCH 242/364] * grub-core/gfxmenu/gui_circular_progress.c:
Take both width and height into account when calculating radius.
---
ChangeLog | 6 ++++++
grub-core/gfxmenu/gui_circular_progress.c | 2 +-
include/grub/misc.h | 3 +++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 8bdb17a..92e8dad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
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.
diff --git a/grub-core/gfxmenu/gui_circular_progress.c b/grub-core/gfxmenu/gui_circular_progress.c
index d07ca6e..e06d40c 100644
--- a/grub-core/gfxmenu/gui_circular_progress.c
+++ b/grub-core/gfxmenu/gui_circular_progress.c
@@ -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;
diff --git a/include/grub/misc.h b/include/grub/misc.h
index f0ecaec..c953a00 100644
--- a/include/grub/misc.h
+++ b/include/grub/misc.h
@@ -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 */
--
1.8.1.4