mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-02 18:37:38 +01:00
TAChart: Add AntialiasingMode property
git-svn-id: trunk@30410 -
This commit is contained in:
parent
c7df2d5f85
commit
45279d3513
@ -67,6 +67,7 @@ type
|
||||
AStartAngle16Deg, AAngleLength16Deg: Integer);
|
||||
procedure Rectangle(const ARect: TRect);
|
||||
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
|
||||
procedure SetAntialiasingMode(AValue: TChartAntialiasingMode);
|
||||
procedure SetBrushColor(AColor: TChartColor);
|
||||
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
|
||||
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
|
||||
@ -223,6 +224,11 @@ begin
|
||||
FCanvas.Rectangle(ARect);
|
||||
end;
|
||||
|
||||
procedure TCanvasDrawer.SetAntialiasingMode(AValue: TChartAntialiasingMode);
|
||||
begin
|
||||
FCanvas.AntialiasingMode := TAntialiasingMode(AValue);
|
||||
end;
|
||||
|
||||
procedure TCanvasDrawer.SetBrush(ABrush: TFPCustomBrush);
|
||||
begin
|
||||
FCanvas.Brush.Assign(ABrush);
|
||||
|
||||
@ -24,7 +24,9 @@ uses
|
||||
Classes, FPCanvas, FPImage, Types;
|
||||
|
||||
type
|
||||
// Same types as in Graphics unit, but without dependency.
|
||||
TChartColor = -$7FFFFFFF-1..$7FFFFFFF;
|
||||
TChartAntialiasingMode = (amDontCare, amOn, amOff);
|
||||
|
||||
type
|
||||
|
||||
@ -94,6 +96,7 @@ type
|
||||
procedure Rectangle(const ARect: TRect);
|
||||
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
|
||||
function Scale(ADistance: Integer): Integer;
|
||||
procedure SetAntialiasingMode(AValue: TChartAntialiasingMode);
|
||||
procedure SetBrushColor(AColor: TChartColor);
|
||||
procedure SetBrush(ABrush: TFPCustomBrush);
|
||||
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
|
||||
@ -137,6 +140,7 @@ type
|
||||
procedure Polygon(
|
||||
const APoints: array of TPoint; AStartIndex, ANumPts: Integer); virtual; abstract;
|
||||
function Scale(ADistance: Integer): Integer; virtual;
|
||||
procedure SetAntialiasingMode(AValue: TChartAntialiasingMode);
|
||||
procedure SetDoChartColorToFPColorFunc(AValue: TChartColorToFPColorFunc);
|
||||
procedure SetGetFontOrientationFunc(AValue: TGetFontOrientationFunc);
|
||||
function TextExtent(const AText: String): TPoint;
|
||||
@ -315,6 +319,11 @@ begin
|
||||
Result := ADistance;
|
||||
end;
|
||||
|
||||
procedure TBasicDrawer.SetAntialiasingMode(AValue: TChartAntialiasingMode);
|
||||
begin
|
||||
Unused(AValue);
|
||||
end;
|
||||
|
||||
procedure TBasicDrawer.SetDoChartColorToFPColorFunc(
|
||||
AValue: TChartColorToFPColorFunc);
|
||||
begin
|
||||
|
||||
@ -153,6 +153,7 @@ type
|
||||
TChart = class(TCustomChart, ICoordTransformer)
|
||||
private // Property fields
|
||||
FAllowZoom: Boolean;
|
||||
FAntialiasingMode: TChartAntialiasingMode;
|
||||
FAxisList: TChartAxisList;
|
||||
FAxisVisible: Boolean;
|
||||
FBackColor: TColor;
|
||||
@ -207,6 +208,7 @@ type
|
||||
function GetToolset: TBasicChartToolset;
|
||||
procedure HideReticule;
|
||||
|
||||
procedure SetAntialiasingMode(AValue: TChartAntialiasingMode);
|
||||
procedure SetAxis(AIndex: Integer; AValue: TChartAxis);
|
||||
procedure SetAxisList(AValue: TChartAxisList);
|
||||
procedure SetAxisVisible(Value: Boolean);
|
||||
@ -314,6 +316,8 @@ type
|
||||
|
||||
published
|
||||
property AllowZoom: Boolean read FAllowZoom write FAllowZoom default true;
|
||||
property AntialiasingMode: TChartAntialiasingMode
|
||||
read FAntialiasingMode write SetAntialiasingMode default amDontCare;
|
||||
property AxisList: TChartAxisList read FAxisList write SetAxisList;
|
||||
property AxisVisible: Boolean read FAxisVisible write SetAxisVisible default true;
|
||||
property BackColor: TColor read FBackColor write SetBackColor default clBtnFace;
|
||||
@ -529,6 +533,7 @@ begin
|
||||
FBroadcaster := TBroadcaster.Create;
|
||||
FExtentBroadcaster := TBroadcaster.Create;
|
||||
FAllowZoom := true;
|
||||
FAntialiasingMode := amDontCare;
|
||||
FAxisVisible := true;
|
||||
FDrawer := TCanvasDrawer.Create(Canvas);
|
||||
|
||||
@ -678,6 +683,7 @@ var
|
||||
legendRect: TRect;
|
||||
begin
|
||||
ADrawer.DrawingBegin(ARect);
|
||||
ADrawer.SetAntialiasingMode(AntialiasingMode);
|
||||
Clear(ADrawer, ARect);
|
||||
|
||||
FClipRect := ARect;
|
||||
@ -1103,6 +1109,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChart.SetAntialiasingMode(AValue: TChartAntialiasingMode);
|
||||
begin
|
||||
if FAntialiasingMode = AValue then exit;
|
||||
FAntialiasingMode := AValue;
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TChart.SetAxis(AIndex: Integer; AValue: TChartAxis);
|
||||
begin
|
||||
FAxisList.SetAxis(AIndex, AValue);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user