mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 11:10:16 +02:00
TAChart: Use IChartDrawer to draw TUserDrawnSeries. Remove Draw(ACanvas) from TBasicChartSeries
git-svn-id: trunk@29638 -
This commit is contained in:
parent
f72f36bdd3
commit
abd9e9a7df
@ -78,8 +78,7 @@ type
|
||||
destructor Destroy; override;
|
||||
|
||||
public
|
||||
procedure Draw(ADrawer: IChartDrawer); virtual;
|
||||
procedure Draw(ACanvas: TCanvas); virtual;
|
||||
procedure Draw(ADrawer: IChartDrawer); virtual; abstract;
|
||||
function IsEmpty: Boolean; virtual; abstract;
|
||||
procedure MovePoint(var AIndex: Integer; const ANewPos: TPoint); virtual;
|
||||
|
||||
@ -1260,17 +1259,6 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TBasicChartSeries.Draw(ADrawer: IChartDrawer);
|
||||
begin
|
||||
Draw(ADrawer.Canvas);
|
||||
end;
|
||||
|
||||
procedure TBasicChartSeries.Draw(ACanvas: TCanvas);
|
||||
begin
|
||||
Unused(ACanvas);
|
||||
raise EChartError(ClassName + '.Draw not implemented');
|
||||
end;
|
||||
|
||||
function TBasicChartSeries.GraphToAxisX(AX: Double): Double;
|
||||
begin
|
||||
Result := AX;
|
||||
|
@ -297,7 +297,7 @@ type
|
||||
procedure GetLegendItems(AItems: TChartLegendItems); override;
|
||||
public
|
||||
procedure Assign(ASource: TPersistent); override;
|
||||
procedure Draw(ACanvas: TCanvas); override;
|
||||
procedure Draw(ADrawer: IChartDrawer); override;
|
||||
function IsEmpty: Boolean; override;
|
||||
published
|
||||
property Active default true;
|
||||
@ -1169,10 +1169,10 @@ begin
|
||||
inherited Assign(ASource);
|
||||
end;
|
||||
|
||||
procedure TUserDrawnSeries.Draw(ACanvas: TCanvas);
|
||||
procedure TUserDrawnSeries.Draw(ADrawer: IChartDrawer);
|
||||
begin
|
||||
if Assigned(FOnDraw) then
|
||||
FOnDraw(ACanvas, FChart.ClipRect);
|
||||
if ADrawer.HasCanvas and Assigned(FOnDraw) then
|
||||
FOnDraw(ADrawer.Canvas, FChart.ClipRect);
|
||||
end;
|
||||
|
||||
procedure TUserDrawnSeries.GetBounds(var ABounds: TDoubleRect);
|
||||
|
Loading…
Reference in New Issue
Block a user