]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/gfxmenu/gui_circular_progress.c: Take both width and height
authorVladimir Testov <vladimir.testov@rosalab.ru>
Wed, 3 Apr 2013 07:20:29 +0000 (09:20 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 3 Apr 2013 07:20:29 +0000 (09:20 +0200)
into account when calculating radius.

ChangeLog
grub-core/gfxmenu/gui_circular_progress.c
include/grub/misc.h

index 8bdb17a750d5d16cb5aa8f2ff0b70ddc319fbe69..92e8dadca250734954324cb13871857a03f8c22f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index d07ca6e3c81885876ab140a266cade37d8fe574d..e06d40cdbeb27cbe3ea21ab60c094992e7ea5270 100644 (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;
index f0ecaec3d1a164eb9f7b6debe1620252ed983286..c953a003e26f534d11eeafaf7ea15fb994393c7d 100644 (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 */