[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grub-devel
Subject:    Re: [4/4] [PATCH] incorrect calculation of radius in circular_progress.
From:       Vladimir Testov <vladimir.testov () rosalab ! ru>
Date:       2013-03-20 7:43:38
Message-ID: 3865659.VmfRCEbUhv () icedphoenix
[Download RAW message or body]

fixed.

variables changed to outer_diameter and inner_diameter

It is more human-readable also

-- 
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru
["grub-2.00-radius-correction.patch" (grub-2.00-radius-correction.patch)]

diff -Naur grub-2.00/grub-core/gfxmenu/gui_circular_progress.c \
                grub-new2/grub-core/gfxmenu/gui_circular_progress.c
--- grub-2.00/grub-core/gfxmenu/gui_circular_progress.c	2010-12-01 17:45:43.000000000 \
                +0300
+++ grub-new2/grub-core/gfxmenu/gui_circular_progress.c	2013-03-20 09:03:03.293238118 \
+0400 @@ -138,7 +138,15 @@
                           (height - center_height) / 2, 0, 0,
                           center_width, center_height);
 
-  int radius = width / 2 - tick_width / 2 - 1;
+  int outer_diameter = width;
+  if (height < outer_diameter) {
+    outer_diameter = height;
+  }
+  int inner_diameter = tick_width;
+  if (tick_height > inner_diameter) {
+    inner_diameter = tick_height;
+  }
+  int radius = outer_diameter / 2 - inner_diameter / 2 - 1;
   int nticks;
   int tick_begin;
   int tick_end;



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic