Author: akhaldi
Date: Tue Feb 5 23:02:36 2013
New Revision: 58291
URL: http://svn.reactos.org/svn/reactos?rev=58291&view=rev
Log:
[WIN32SS]
* Fix a corner case when the start segments overlaps the end segment in Chord(), Pie(), Arc() and ArcTo() functions.
* This should fix the Pie chart in "Disk Properties" when all the space is used.
* Brought to you by Victor Martinez Calvo.
CORE-6848 #resolve #comment Committed in r58291. Thanks !
Modified:
trunk/reactos/win32ss/gdi/ntgdi/arc.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/arc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/arc.c?re…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] Tue Feb 5 23:02:36 2013
@@ -131,6 +131,12 @@
AngleEnd = atan2((RectSEpts.bottom - CenterY), RectSEpts.right - CenterX)*(360.0/(M_PI*2));
AngleStart = atan2((RectSEpts.top - CenterY), RectSEpts.left - CenterX)*(360.0/(M_PI*2));
+ /* Edge Case: Check if the start segments overlaps(is equal) the end segment */
+ if (AngleEnd == AngleStart)
+ {
+ AngleStart = AngleEnd + 360.0; // Arc(), ArcTo(), Pie() and Chord() are counterclockwise APIs.
+ }
+
SfCx = (LONG)(Rcos(AngleStart) * RadiusX);
SfCy = (LONG)(Rsin(AngleStart) * RadiusY);
EfCx = (LONG)(Rcos(AngleEnd) * RadiusX);