Author: jimtabor Date: Mon Jun 30 00:11:39 2008 New Revision: 34207
URL: http://svn.reactos.org/svn/reactos?rev=34207&view=rev Log: Fix drawing pie fill aligment.
Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c trunk/reactos/subsystems/win32/win32k/objects/drawing.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] Mon Jun 30 00:11:39 2008 @@ -133,11 +133,14 @@ RectBounds.right = Right; RectBounds.top = Top; RectBounds.bottom = Bottom; + + IntLPtoDP(dc, (LPPOINT)&RectBounds, 2); + DPRINT1("1: Left: %d, Top: %d, Right: %d, Bottom: %d\n", RectBounds.left,RectBounds.top,RectBounds.right,RectBounds.bottom);
- RadiusX = (RectBounds.right - RectBounds.left) / 2; - RadiusY = (RectBounds.bottom - RectBounds.top) / 2; + 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((YRadialEnd - CenterY), XRadialEnd - CenterX)*(360.0/(M_PI*2)); @@ -151,13 +154,13 @@ if ((arctype == GdiTypePie) || (arctype == GdiTypeChord)) { ret = IntFillArc( dc, - RectBounds.left, + RectBounds.left, RectBounds.top, - fabs(RectBounds.right-RectBounds.left), // Width - fabs(RectBounds.bottom-RectBounds.top), // Height - AngleStart, - AngleEnd, - arctype); + abs(RectBounds.right-RectBounds.left), // Width + abs(RectBounds.bottom-RectBounds.top), // Height + AngleStart, + AngleEnd, + arctype); }
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
Modified: trunk/reactos/subsystems/win32/win32k/objects/drawing.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/drawing.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/drawing.c [iso-8859-1] Mon Jun 30 00:11:39 2008 @@ -802,7 +802,12 @@ r.y = YLeft; r.width = Width; r.height = Height; - app_fill_arc(dc, r, Start-90, End-90, FillBrushObj, Chord); + // Sort out alignment here. + app_fill_arc(dc, r, + (dc->DcLevel.flPath & DCPATH_CLOCKWISE) ? -End : -Start, + (dc->DcLevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End, + FillBrushObj, Chord); +
BRUSHOBJ_UnlockBrush(FillBrushObj); return TRUE;