- Fix Ellipes, for Filip Navara, nice work!

- Ref: http://www.reactos.org/archives/public/ros-dev/2007-January/009090.html
- Test: 46ace072/attachment-0001.exe

svn path=/trunk/; revision=33907
This commit is contained in:
James Tabor 2008-06-09 16:46:52 +00:00
parent ada39af182
commit 1662719886

View file

@ -166,6 +166,8 @@ IntGdiPolyPolygon(DC *dc,
return TRUE; return TRUE;
} }
/******************************************************************************/ /******************************************************************************/
/* /*
@ -205,12 +207,22 @@ NtGdiEllipse(
PDC dc; PDC dc;
PDC_ATTR Dc_Attr; PDC_ATTR Dc_Attr;
BOOL ret = TRUE, Cond1, Cond2; BOOL ret = TRUE, Cond1, Cond2;
/* top
___________________
+| |
| |
| |
left | | right
| |
| |
0|___________________|
0 bottom +
*/
/* /*
* Check the parameters. * Check the parameters.
*/ */
DPRINT("nLeftRect: %d, nTopRect: %d, nRightRect: %d, nBottomRect: %d\n",nLeftRect,nTopRect,nRightRect,nBottomRect);
if (nRightRect <= nLeftRect || nBottomRect <= nTopRect) if (nRightRect <= nLeftRect || nTopRect <= nBottomRect)
{ {
SetLastWin32Error(ERROR_INVALID_PARAMETER); SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE; return FALSE;
@ -272,28 +284,25 @@ NtGdiEllipse(
RectBounds.bottom = nBottomRect; RectBounds.bottom = nBottomRect;
IntLPtoDP(dc, (LPPOINT)&RectBounds, 2); IntLPtoDP(dc, (LPPOINT)&RectBounds, 2);
DPRINT("1: Left: %d, Top: %d, Right: %d, Bottom: %d\n",
RectBounds.left,RectBounds.top,RectBounds.right,RectBounds.bottom);
RectBounds.left += dc->ptlDCOrig.x; RectBounds.left += dc->ptlDCOrig.x;
RectBounds.right += dc->ptlDCOrig.x; RectBounds.right += dc->ptlDCOrig.x;
RectBounds.top += dc->ptlDCOrig.y; RectBounds.top += dc->ptlDCOrig.y;
RectBounds.bottom += dc->ptlDCOrig.y; RectBounds.bottom += dc->ptlDCOrig.y;
DPRINT("2: Left: %d, Top: %d, Right: %d, Bottom: %d\n",
RectBounds.left,RectBounds.top,RectBounds.right,RectBounds.bottom);
RadiusX = max((RectBounds.right - RectBounds.left) >> 1, 1); RadiusX = (RectBounds.right - RectBounds.left)/2;
RadiusY = max((RectBounds.bottom - RectBounds.top) >> 1, 1); RadiusY = (RectBounds.bottom - RectBounds.top)/2;
CenterX = RectBounds.left + RadiusX; CenterX = RectBounds.left + RadiusX;
CenterY = RectBounds.top + RadiusY; CenterY = RectBounds.top + RadiusY;
DPRINT("3: RadiusX: %d, RadiusY: %d, CenterX: %d, CenterY: %d\n",
RadiusX,RadiusY,CenterX,CenterY);
if (RadiusX > RadiusY) nx = RadiusX;
{ ny = -RadiusY;
nx = RadiusX;
ny = RadiusY;
}
else
{
nx = RadiusY;
ny = RadiusX;
}
da = -1; da = -1;
db = 0xFFFF; db = 0xFFFF;
ix = 0; ix = 0;
@ -389,7 +398,7 @@ NtGdiEllipse(
BRUSHOBJ_UnlockBrush(FillBrush); BRUSHOBJ_UnlockBrush(FillBrush);
PENOBJ_UnlockPen(PenBrush); PENOBJ_UnlockPen(PenBrush);
DC_UnlockDc(dc); DC_UnlockDc(dc);
DPRINT("NtGdiEllipse exit \n");
return ret; return ret;
} }