Commit 04f0bf21 authored by Juha Manninen's avatar Juha Manninen
Browse files

LCL: Fix default implementations of Arc, Chord and Pie functions. Issue #30194, patch from errno.

git-svn-id: trunk@52405 -
parent 93fb04d8
......@@ -569,18 +569,26 @@ function TWidgetSet.RadialArc(DC: HDC;
left, top, right, bottom, sx, sy, ex, ey: Integer): Boolean;
var
A1, A2: Extended;
A2i : integer;
begin
Coords2Angles(left, top, right-left, bottom-top, sx, sy, ex, ey, A1, A2);
Result := Arc(DC, left, top, right, bottom, RoundToInt(A1), RoundToInt(A2));
A2i := RoundToInt(A2);
if A2i = 0 then
A2i := 5760;
Result := Arc(DC, left, top, right, bottom, RoundToInt(A1), A2i);
end;
function TWidgetSet.RadialChord(DC: HDC;
x1, y1, x2, y2, sx, sy, ex, ey: Integer): Boolean;
var
A1, A2: Extended;
A2i : integer;
Begin
Coords2Angles(x1, y1, x2-x1, y2-y1, sx, sy, ex, ey, A1, A2);
Result := AngleChord(DC, x1, y1, x2, y2, RoundToInt(A1), RoundToInt(A2));
A2i := RoundToInt(A2);
if A2i = 0 then
A2i := 5760;
Result := AngleChord(DC, x1, y1, x2, y2, RoundToInt(A1), A2i);
End;
function TWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2,
......
......@@ -1711,9 +1711,13 @@ function TWidgetSet.Pie(DC: HDC; x1, y1, x2, y2,
sx, sy, ex, ey: Integer): Boolean;
var
A1, A2: extended;
A2i: integer;
begin
Coords2Angles(x1, y1, x2-x1, y2-y1, sx, sy, ex, ey, A1, A2);
Result := RadialPie(DC, x1, y1, x2, y2, RoundToInt(A1), RoundToInt(A2));
A2i := RoundToInt(A2);
if A2i = 0 then
A2i := 5760;
Result := RadialPie(DC, x1, y1, x2, y2, RoundToInt(A1), A2i);
end;
function TWidgetSet.PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment