mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:39:21 +02:00
tachart: Fixes compilation because now fpvectorial uses TFPColor
git-svn-id: trunk@31245 -
This commit is contained in:
parent
9a6b6f2418
commit
206e4d5b90
@ -26,6 +26,7 @@
|
|||||||
<RunParams>
|
<RunParams>
|
||||||
<local>
|
<local>
|
||||||
<FormatVersion Value="1"/>
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="\usr\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<RequiredPackages Count="5">
|
<RequiredPackages Count="5">
|
||||||
|
@ -20,7 +20,7 @@ unit TADrawerFPVectorial;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, FPCanvas, FPVectorial, TADrawUtils;
|
Classes, FPCanvas, FPVectorial, TADrawUtils, fpimage;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -28,10 +28,11 @@ type
|
|||||||
|
|
||||||
TFPVectorialDrawer = class(TBasicDrawer, IChartDrawer)
|
TFPVectorialDrawer = class(TBasicDrawer, IChartDrawer)
|
||||||
strict private
|
strict private
|
||||||
FBrushColor: TvColor;
|
FBrushColor: TFPColor;
|
||||||
|
FBrushStyle: TFPBrushStyle;
|
||||||
FCanvas: TvVectorialDocument;
|
FCanvas: TvVectorialDocument;
|
||||||
FFontSize: Integer;
|
FFontSize: Integer;
|
||||||
FPenColor: TvColor;
|
FPenColor: TFPColor;
|
||||||
strict protected
|
strict protected
|
||||||
function GetFontAngle: Double; override;
|
function GetFontAngle: Double; override;
|
||||||
procedure SetBrush(ABrush: TFPCustomBrush);
|
procedure SetBrush(ABrush: TFPCustomBrush);
|
||||||
@ -71,21 +72,7 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Math, TAChartUtils, TAGeometry;
|
Math, TAChartUtils, TAGeometry, fpvutils;
|
||||||
|
|
||||||
function ChartColorToVColor(AColor: TChartColor): TvColor;
|
|
||||||
begin
|
|
||||||
Result.Alpha := 255;
|
|
||||||
Result.Red := AColor;
|
|
||||||
Result.Green := AColor shr 8;
|
|
||||||
Result.Blue := AColor shr 16;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function VColorToChartColor(AColor: TvColor): TChartColor;
|
|
||||||
begin
|
|
||||||
with AColor do
|
|
||||||
Result := Red + (Green shl 8) + (Blue shl 16);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TFPVectorialDrawer }
|
{ TFPVectorialDrawer }
|
||||||
|
|
||||||
@ -137,7 +124,7 @@ end;
|
|||||||
|
|
||||||
function TFPVectorialDrawer.GetBrushColor: TChartColor;
|
function TFPVectorialDrawer.GetBrushColor: TChartColor;
|
||||||
begin
|
begin
|
||||||
Result := VColorToChartColor(FBrushColor);
|
Result := FPColorToChartColor(FBrushColor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFPVectorialDrawer.GetFontAngle: Double;
|
function TFPVectorialDrawer.GetFontAngle: Double;
|
||||||
@ -198,7 +185,7 @@ end;
|
|||||||
|
|
||||||
procedure TFPVectorialDrawer.PrepareSimplePen(AColor: TChartColor);
|
procedure TFPVectorialDrawer.PrepareSimplePen(AColor: TChartColor);
|
||||||
begin
|
begin
|
||||||
FPenColor := ChartColorToVColor(AColor);
|
FPenColor := ChartColorToFPColor(AColor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFPVectorialDrawer.RadialPie(
|
procedure TFPVectorialDrawer.RadialPie(
|
||||||
@ -215,7 +202,7 @@ begin
|
|||||||
FCanvas.AddLineToPath(AX1, AY2);
|
FCanvas.AddLineToPath(AX1, AY2);
|
||||||
FCanvas.AddLineToPath(AX1, AY1);
|
FCanvas.AddLineToPath(AX1, AY1);
|
||||||
FCanvas.SetBrushColor(FBrushColor);
|
FCanvas.SetBrushColor(FBrushColor);
|
||||||
FCanvas.SetBrushStyle(bsSolid);
|
FCanvas.SetBrushStyle(FBrushStyle);
|
||||||
FCanvas.SetPenColor(FPenColor);
|
FCanvas.SetPenColor(FPenColor);
|
||||||
FCanvas.EndPath();
|
FCanvas.EndPath();
|
||||||
end;
|
end;
|
||||||
@ -228,12 +215,13 @@ end;
|
|||||||
|
|
||||||
procedure TFPVectorialDrawer.SetBrush(ABrush: TFPCustomBrush);
|
procedure TFPVectorialDrawer.SetBrush(ABrush: TFPCustomBrush);
|
||||||
begin
|
begin
|
||||||
FBrushColor := ChartColorToVColor(FPColorToChartColor(ABrush.FPColor));
|
FBrushColor := ABrush.FPColor;
|
||||||
|
FBrushStyle := ABrush.Style;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFPVectorialDrawer.SetBrushColor(AColor: TChartColor);
|
procedure TFPVectorialDrawer.SetBrushColor(AColor: TChartColor);
|
||||||
begin
|
begin
|
||||||
FBrushColor := ChartColorToVColor(AColor);
|
FBrushColor := ChartColorToFPColor(AColor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFPVectorialDrawer.SetBrushParams(
|
procedure TFPVectorialDrawer.SetBrushParams(
|
||||||
@ -250,14 +238,14 @@ end;
|
|||||||
|
|
||||||
procedure TFPVectorialDrawer.SetPen(APen: TFPCustomPen);
|
procedure TFPVectorialDrawer.SetPen(APen: TFPCustomPen);
|
||||||
begin
|
begin
|
||||||
FPenColor := ChartColorToVColor(FPColorToChartColor(APen.FPColor));
|
FPenColor := APen.FPColor;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFPVectorialDrawer.SetPenParams(
|
procedure TFPVectorialDrawer.SetPenParams(
|
||||||
AStyle: TFPPenStyle; AColor: TChartColor);
|
AStyle: TFPPenStyle; AColor: TChartColor);
|
||||||
begin
|
begin
|
||||||
Unused(AStyle);
|
Unused(AStyle);
|
||||||
FPenColor := ChartColorToVColor(AColor);
|
FPenColor := ChartColorToFPColor(AColor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFPVectorialDrawer.SimpleTextExtent(const AText: String): TPoint;
|
function TFPVectorialDrawer.SimpleTextExtent(const AText: String): TPoint;
|
||||||
|
Loading…
Reference in New Issue
Block a user