Blame SOURCES/0243-grub-core-gfxmenu-gui_circular_progress.c-Take-both-.patch

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