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));
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);
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;