a5bd9f
From a2575f0e5de45c022ed54a5b368e82b2a688c73e Mon Sep 17 00:00:00 2001
a5bd9f
From: Vladimir Testov <vladimir.testov@rosalab.ru>
a5bd9f
Date: Wed, 3 Apr 2013 09:20:29 +0200
a5bd9f
Subject: [PATCH 242/364] 	* grub-core/gfxmenu/gui_circular_progress.c:
a5bd9f
 Take both width and height 	into account when calculating radius.
a5bd9f
a5bd9f
---
a5bd9f
 ChangeLog                                 | 6 ++++++
a5bd9f
 grub-core/gfxmenu/gui_circular_progress.c | 2 +-
a5bd9f
 include/grub/misc.h                       | 3 +++
a5bd9f
 3 files changed, 10 insertions(+), 1 deletion(-)
a5bd9f
a5bd9f
diff --git a/ChangeLog b/ChangeLog
a5bd9f
index 8bdb17a..92e8dad 100644
a5bd9f
--- a/ChangeLog
a5bd9f
+++ b/ChangeLog
a5bd9f
@@ -1,4 +1,10 @@
a5bd9f
 2013-04-03  Vladimir Testov <vladimir.testov@rosalab.ru>
a5bd9f
+2013-04-03  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f
+
a5bd9f
+	* grub-core/gfxmenu/gui_circular_progress.c: Take both width and height
a5bd9f
+	into account when calculating radius.
a5bd9f
+
a5bd9f
+2013-04-03  Vladimir Testov <vladimir.testov@rosalab.ru>
a5bd9f
 
a5bd9f
 	* grub-core/gfxmenu/view.c: Fix off-by-one error.
a5bd9f
 
a5bd9f
diff --git a/grub-core/gfxmenu/gui_circular_progress.c b/grub-core/gfxmenu/gui_circular_progress.c
a5bd9f
index d07ca6e..e06d40c 100644
a5bd9f
--- a/grub-core/gfxmenu/gui_circular_progress.c
a5bd9f
+++ b/grub-core/gfxmenu/gui_circular_progress.c
a5bd9f
@@ -138,7 +138,7 @@ circprog_paint (void *vself, const grub_video_rect_t *region)
a5bd9f
                           (height - center_height) / 2, 0, 0,
a5bd9f
                           center_width, center_height);
a5bd9f
 
a5bd9f
-  int radius = width / 2 - tick_width / 2 - 1;
a5bd9f
+  int radius = grub_min (height, width) / 2 - grub_max (tick_height, tick_width) / 2 - 1;
a5bd9f
   int nticks;
a5bd9f
   int tick_begin;
a5bd9f
   int tick_end;
a5bd9f
diff --git a/include/grub/misc.h b/include/grub/misc.h
a5bd9f
index f0ecaec..c953a00 100644
a5bd9f
--- a/include/grub/misc.h
a5bd9f
+++ b/include/grub/misc.h
a5bd9f
@@ -478,4 +478,7 @@ void EXPORT_FUNC(grub_real_boot_time) (const char *file,
a5bd9f
 #define grub_boot_time(fmt, args...) 
a5bd9f
 #endif
a5bd9f
 
a5bd9f
+#define grub_max(a, b) (((a) > (b)) ? (a) : (b))
a5bd9f
+#define grub_min(a, b) (((a) < (b)) ? (a) : (b))
a5bd9f
+
a5bd9f
 #endif /* ! GRUB_MISC_HEADER */
a5bd9f
-- 
a5bd9f
1.8.1.4
a5bd9f