diff --git a/reactos/subsystems/win32/win32k/objects/arc.c b/reactos/subsystems/win32/win32k/objects/arc.c index 3138e2521a9..c0eed680846 100644 --- a/reactos/subsystems/win32/win32k/objects/arc.c +++ b/reactos/subsystems/win32/win32k/objects/arc.c @@ -133,11 +133,14 @@ IntArc( DC *dc, 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 @@ IntArc( DC *dc, 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); diff --git a/reactos/subsystems/win32/win32k/objects/drawing.c b/reactos/subsystems/win32/win32k/objects/drawing.c index 14fa7dd1935..35f881ce3cb 100755 --- a/reactos/subsystems/win32/win32k/objects/drawing.c +++ b/reactos/subsystems/win32/win32k/objects/drawing.c @@ -802,7 +802,12 @@ IntFillArc( PDC dc, 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;