mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 17:00:57 +02:00
TAChart: Rename TFPCanvasDrawer -> TBasicDrawer, move Colors constant to the location of usage
git-svn-id: trunk@29954 -
This commit is contained in:
parent
a7816a6197
commit
9487b41cc5
@ -26,7 +26,7 @@ type
|
||||
|
||||
{ TAggPasDrawer }
|
||||
|
||||
TAggPasDrawer = class(TFPCanvasDrawer, IChartDrawer, ISimpleTextOut)
|
||||
TAggPasDrawer = class(TBasicDrawer, IChartDrawer, ISimpleTextOut)
|
||||
strict private
|
||||
FCanvas: TAggLCLCanvas;
|
||||
procedure SetBrush(ABrush: TFPCustomBrush);
|
||||
|
@ -27,7 +27,7 @@ type
|
||||
|
||||
{ TOpenGLDrawer }
|
||||
|
||||
TOpenGLDrawer = class(TFPCanvasDrawer, IChartDrawer)
|
||||
TOpenGLDrawer = class(TBasicDrawer, IChartDrawer)
|
||||
strict private
|
||||
FBrushColor: TFPColor;
|
||||
FContext: TOpenGLControl;
|
||||
|
@ -26,11 +26,6 @@ uses
|
||||
type
|
||||
TChartColor = -$7FFFFFFF-1..$7FFFFFFF;
|
||||
|
||||
const
|
||||
Colors: array [1..15] of TColor = (
|
||||
clRed, clGreen, clYellow, clBlue, clWhite, clGray, clFuchsia,
|
||||
clTeal, clNavy, clMaroon, clLime, clOlive, clPurple, clSilver, clAqua);
|
||||
|
||||
type
|
||||
|
||||
ISimpleTextOut = interface
|
||||
@ -117,9 +112,9 @@ type
|
||||
property Pen: TFPCustomPen write SetPen;
|
||||
end;
|
||||
|
||||
{ TFPCanvasDrawer }
|
||||
{ TBasicDrawer }
|
||||
|
||||
TFPCanvasDrawer = class(TInterfacedObject, ISimpleTextOut)
|
||||
TBasicDrawer = class(TInterfacedObject, ISimpleTextOut)
|
||||
strict protected
|
||||
function GetFontAngle: Double; virtual; abstract;
|
||||
function SimpleTextExtent(const AText: String): TPoint; virtual; abstract;
|
||||
@ -143,7 +138,7 @@ type
|
||||
{ TCanvasDrawer }
|
||||
|
||||
TCanvasDrawer = class(
|
||||
TFPCanvasDrawer, IChartDrawer, IChartTCanvasDrawer)
|
||||
TBasicDrawer, IChartDrawer, IChartTCanvasDrawer)
|
||||
private
|
||||
FCanvas: TCanvas;
|
||||
procedure SetBrush(ABrush: TFPCustomBrush);
|
||||
@ -292,14 +287,14 @@ begin
|
||||
Result := Self;
|
||||
end;
|
||||
|
||||
{ TFPCanvasDrawer }
|
||||
{ TBasicDrawer }
|
||||
|
||||
procedure TFPCanvasDrawer.DrawLineDepth(AX1, AY1, AX2, AY2, ADepth: Integer);
|
||||
procedure TBasicDrawer.DrawLineDepth(AX1, AY1, AX2, AY2, ADepth: Integer);
|
||||
begin
|
||||
DrawLineDepth(Point(AX1, AY1), Point(AX2, AY2), ADepth);
|
||||
end;
|
||||
|
||||
procedure TFPCanvasDrawer.DrawLineDepth(const AP1, AP2: TPoint; ADepth: Integer);
|
||||
procedure TBasicDrawer.DrawLineDepth(const AP1, AP2: TPoint; ADepth: Integer);
|
||||
var
|
||||
d: TPoint;
|
||||
begin
|
||||
@ -307,22 +302,22 @@ begin
|
||||
Polygon([AP1, AP1 + d, AP2 + d, AP2]);
|
||||
end;
|
||||
|
||||
procedure TFPCanvasDrawer.LineTo(const AP: TPoint);
|
||||
procedure TBasicDrawer.LineTo(const AP: TPoint);
|
||||
begin
|
||||
LineTo(AP.X, AP.Y)
|
||||
end;
|
||||
|
||||
procedure TFPCanvasDrawer.MoveTo(const AP: TPoint);
|
||||
procedure TBasicDrawer.MoveTo(const AP: TPoint);
|
||||
begin
|
||||
MoveTo(AP.X, AP.Y)
|
||||
end;
|
||||
|
||||
function TFPCanvasDrawer.Scale(ADistance: Integer): Integer;
|
||||
function TBasicDrawer.Scale(ADistance: Integer): Integer;
|
||||
begin
|
||||
Result := ADistance;
|
||||
end;
|
||||
|
||||
function TFPCanvasDrawer.TextExtent(const AText: String): TPoint;
|
||||
function TBasicDrawer.TextExtent(const AText: String): TPoint;
|
||||
var
|
||||
sl: TStrings;
|
||||
begin
|
||||
@ -337,7 +332,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFPCanvasDrawer.TextExtent(AText: TStrings): TPoint;
|
||||
function TBasicDrawer.TextExtent(AText: TStrings): TPoint;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
@ -349,7 +344,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFPCanvasDrawer.TextOut: TChartTextOut;
|
||||
function TBasicDrawer.TextOut: TChartTextOut;
|
||||
begin
|
||||
Result := TChartTextOut.Create(Self);
|
||||
end;
|
||||
|
@ -269,9 +269,14 @@ begin
|
||||
end;
|
||||
|
||||
function TCustomPieSeries.SliceColor(AIndex: Integer): TColor;
|
||||
const
|
||||
SLICE_COLORS: array [1..15] of TColor = (
|
||||
clRed, clGreen, clYellow, clBlue, clWhite, clGray, clFuchsia,
|
||||
clTeal, clNavy, clMaroon, clLime, clOlive, clPurple, clSilver, clAqua);
|
||||
begin
|
||||
Result :=
|
||||
ColorOrDefault(Source[AIndex]^.Color, Colors[AIndex mod High(Colors) + 1]);
|
||||
ColorOrDefault(
|
||||
Source[AIndex]^.Color, SLICE_COLORS[AIndex mod High(SLICE_COLORS) + 1]);
|
||||
end;
|
||||
|
||||
function TCustomPieSeries.TryRadius(ADrawer: IChartDrawer): TRect;
|
||||
|
Loading…
Reference in New Issue
Block a user