From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UIDgV-0004vc-OC for mharc-grub-devel@gnu.org; Wed, 20 Mar 2013 03:43:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIDgU-0004vT-5Z for grub-devel@gnu.org; Wed, 20 Mar 2013 03:43:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIDgT-0002pg-20 for grub-devel@gnu.org; Wed, 20 Mar 2013 03:43:42 -0400 Received: from collab.rosalab.ru ([217.199.216.181]:46536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIDgS-0002pX-Qt for grub-devel@gnu.org; Wed, 20 Mar 2013 03:43:40 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by collab.rosalab.ru (Postfix) with ESMTP id 1147E29C31A for ; Wed, 20 Mar 2013 11:43:40 +0400 (MSK) X-Virus-Scanned: amavisd-new at rosalab.ru Received: from collab.rosalab.ru ([127.0.0.1]) by localhost (collab.rosalab.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DlrMVM9iA4Xe for ; Wed, 20 Mar 2013 11:43:39 +0400 (MSK) Received: from icedphoenix.localnet (unknown [10.168.1.56]) by collab.rosalab.ru (Postfix) with ESMTPSA id 53CBF29C318 for ; Wed, 20 Mar 2013 11:43:39 +0400 (MSK) From: Vladimir Testov To: grub-devel@gnu.org Subject: Re: [4/4] [PATCH] incorrect calculation of radius in circular_progress. Date: Wed, 20 Mar 2013 11:43:38 +0400 Message-ID: <3865659.VmfRCEbUhv@icedphoenix> User-Agent: KMail/4.9.4 (Linux/3.5.0-23-generic; KDE/4.9.4; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart25257216.eQ7MPqhke6" Content-Transfer-Encoding: 7Bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 217.199.216.181 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2013 07:43:43 -0000 This is a multi-part message in MIME format. --nextPart25257216.eQ7MPqhke6 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 --nextPart25257216.eQ7MPqhke6 Content-Disposition: attachment; filename="grub-2.00-radius-correction.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="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; --nextPart25257216.eQ7MPqhke6--