mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 02:28:04 +02:00
LCL: Implement TCanvas.AngleArc. Issue #7290, patch from ocean.
git-svn-id: trunk@46262 -
This commit is contained in:
parent
54251b8f1d
commit
27f7ed9453
@ -1151,6 +1151,7 @@ type
|
||||
procedure Arc(ALeft, ATop, ARight, ABottom, Angle16Deg, Angle16DegLength: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
||||
procedure Arc(ALeft, ATop, ARight, ABottom, SX, SY, EX, EY: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
||||
procedure ArcTo(ALeft, ATop, ARight, ABottom, SX, SY, EX, EY: Integer); virtual; //As Arc(), but updates pen position
|
||||
procedure AngleArc(X, Y: Integer; Radius: Longword; StartAngle, SweepAngle: Single);
|
||||
procedure BrushCopy(ADestRect: TRect; ABitmap: TBitmap; ASourceRect: TRect;
|
||||
ATransparentColor: TColor); virtual;
|
||||
procedure Chord(x1, y1, x2, y2,
|
||||
|
@ -679,6 +679,21 @@ begin
|
||||
MoveTo(RadialPoint(EccentricAngle(Point(EX, EY), r), r));
|
||||
end;
|
||||
|
||||
procedure TCanvas.AngleArc(X, Y: Integer; Radius: Longword; StartAngle, SweepAngle: Single);
|
||||
var x1, y1, x2, y2: integer;
|
||||
begin
|
||||
x1:=trunc(x+cos(pi*StartAngle/180)*Radius);
|
||||
y1:=trunc(y-sin(pi*StartAngle/180)*Radius);
|
||||
x2:=trunc(x+cos(pi*(StartAngle+SweepAngle)/180)*Radius);
|
||||
y2:=trunc(y-sin(pi*(StartAngle+SweepAngle)/180)*Radius);
|
||||
LineTo(x1,y1);
|
||||
if SweepAngle>0 then
|
||||
Arc(x-Radius, y-Radius, x+Radius, y+Radius, x1, y1, x2, y2)
|
||||
else
|
||||
Arc(x-Radius, y-Radius, x+Radius, y+Radius, x2, y2, x1, y1);
|
||||
MoveTo(x2,y2);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCanvas.Arc
|
||||
Params: ALeft, ATop, ARight, ABottom, sx, sy, ex, ey
|
||||
|
Loading…
Reference in New Issue
Block a user