LCL: Add ArcTo function to TCanvas class. Issue #7230, patch from Howard Page-Clark

git-svn-id: trunk@46246 -
This commit is contained in:
juha 2014-09-17 16:30:32 +00:00
parent 4ddd6b9e3d
commit 97c1246eea
2 changed files with 10 additions and 0 deletions

View File

@ -1150,6 +1150,7 @@ type
// extra drawing methods (there are more in the ancestor TFPCustomCanvas)
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 BrushCopy(ADestRect: TRect; ABitmap: TBitmap; ASourceRect: TRect;
ATransparentColor: TColor); virtual;
procedure Chord(x1, y1, x2, y2,

View File

@ -670,6 +670,15 @@ begin
Changed;
end;
procedure TCanvas.ArcTo(ALeft, ATop, ARight, ABottom, SX, SY, EX, EY: Integer);
var
r: TRect;
begin
Arc(ALeft, ATop, ARight, ABottom, SX, SY, EX, EY);
r:=Rect(ALeft, ATop, ARight, ABottom);
MoveTo(RadialPoint(EccentricAngle(Point(EX, EY), r), r));
end;
{------------------------------------------------------------------------------
Method: TCanvas.Arc
Params: ALeft, ATop, ARight, ABottom, sx, sy, ex, ey