Author: akhaldi
Date: Sat Apr 25 17:30:43 2015
New Revision: 67420
URL:
http://svn.reactos.org/svn/reactos?rev=67420&view=rev
Log:
[WIN32K] Fix drawing the Start and End Segments with Pie(). Brought to you by Barrett
Karish. CORE-6851
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] Sat Apr 25 17:30:43 2015
@@ -21,9 +21,6 @@
x1, y1, x2, y2, \
&RectBounds, \
ROP2_TO_MIX(pdcattr->jROP2));
-
-#define Rsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0)))
-#define Rcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0)))
static
BOOL
@@ -46,8 +43,7 @@
BOOL ret = TRUE;
LONG PenWidth, PenOrigWidth;
double AngleStart, AngleEnd;
- LONG RadiusX, RadiusY, CenterX, CenterY;
- LONG SfCx, SfCy, EfCx, EfCy;
+ LONG CenterX, CenterY;
if (Right < Left)
{
@@ -124,8 +120,6 @@
DPRINT("1: Left: %d, Top: %d, Right: %d, Bottom: %d\n",
RectBounds.left,RectBounds.top,RectBounds.right,RectBounds.bottom);
- RadiusX = max((RectBounds.right - RectBounds.left) / 2, 1);
- RadiusY = max((RectBounds.bottom - RectBounds.top) / 2, 1);
CenterX = (RectBounds.right + RectBounds.left) / 2;
CenterY = (RectBounds.bottom + RectBounds.top) / 2;
AngleEnd = atan2((RectSEpts.bottom - CenterY), RectSEpts.right -
CenterX)*(360.0/(M_PI*2));
@@ -136,11 +130,6 @@
{
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);
- EfCy = (LONG)(Rsin(AngleEnd) * RadiusY);
if ((arctype == GdiTypePie) || (arctype == GdiTypeChord))
{
@@ -175,11 +164,11 @@
if (arctype == GdiTypePie)
{
- PUTLINE(CenterX, CenterY, SfCx + CenterX, SfCy + CenterY, dc->eboLine);
- PUTLINE(EfCx + CenterX, EfCy + CenterY, CenterX, CenterY, dc->eboLine);
+ PUTLINE(CenterX, CenterY, RectSEpts.left, RectSEpts.top, dc->eboLine);
+ PUTLINE(RectSEpts.right, RectSEpts.bottom, CenterX, CenterY, dc->eboLine);
}
if (arctype == GdiTypeChord)
- PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY,
dc->eboLine);
+ PUTLINE(RectSEpts.right, RectSEpts.bottom, RectSEpts.left, RectSEpts.top,
dc->eboLine);
pbrPen->lWidth = PenOrigWidth;
PEN_ShareUnlockPen(pbrPen);