TAChart: Use IChartDrawer to draw TUserDrawnSeries. Remove Draw(ACanvas) from TBasicChartSeries

git-svn-id: trunk@29638 -
This commit is contained in:
ask 2011-02-21 16:43:50 +00:00
parent f72f36bdd3
commit abd9e9a7df
2 changed files with 5 additions and 17 deletions

View File

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

View File

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