mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 22:37:28 +02:00
TAChart: Add TBasicPointSeries.MovePoint overload for graph coordinates
git-svn-id: trunk@38780 -
This commit is contained in:
parent
88ff18a61a
commit
ed154f4797
@ -262,7 +262,7 @@ type
|
||||
function GetNearestPoint(
|
||||
const AParams: TNearestPointParams;
|
||||
out AResults: TNearestPointResults): Boolean; override;
|
||||
procedure MovePoint(var AIndex: Integer; const ANewPos: TPoint); override;
|
||||
procedure MovePoint(var AIndex: Integer; const ANewPos: TDoublePoint); override;
|
||||
property MarkPositions: TLinearMarkPositions
|
||||
read FMarkPositions write SetMarkPositions default lmpOutside;
|
||||
property UseReticule: Boolean
|
||||
@ -1055,15 +1055,12 @@ begin
|
||||
end;
|
||||
|
||||
procedure TBasicPointSeries.MovePoint(
|
||||
var AIndex: Integer; const ANewPos: TPoint);
|
||||
var
|
||||
p: TDoublePoint;
|
||||
var AIndex: Integer; const ANewPos: TDoublePoint);
|
||||
begin
|
||||
if not InRange(AIndex, 0, Count - 1) then exit;
|
||||
p := FChart.ImageToGraph(ANewPos);
|
||||
with ListSource do begin
|
||||
AIndex := SetXValue(AIndex, p.X);
|
||||
SetYValue(AIndex, p.Y);
|
||||
AIndex := SetXValue(AIndex, ANewPos.X);
|
||||
SetYValue(AIndex, ANewPos.Y);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -81,7 +81,8 @@ type
|
||||
procedure Draw(ADrawer: IChartDrawer); virtual; abstract;
|
||||
function GetGraphBounds: TDoubleRect; virtual; abstract;
|
||||
function IsEmpty: Boolean; virtual; abstract;
|
||||
procedure MovePoint(var AIndex: Integer; const ANewPos: TPoint); virtual;
|
||||
procedure MovePoint(var AIndex: Integer; const ANewPos: TPoint); overload; inline;
|
||||
procedure MovePoint(var AIndex: Integer; const ANewPos: TDoublePoint); overload; virtual;
|
||||
|
||||
property Active: Boolean read FActive write SetActive default true;
|
||||
property Depth: TChartDistance read FDepth write SetDepth default 0;
|
||||
@ -1581,11 +1582,17 @@ begin
|
||||
end;
|
||||
|
||||
procedure TBasicChartSeries.MovePoint(
|
||||
var AIndex: Integer; const ANewPos: TPoint);
|
||||
var AIndex: Integer; const ANewPos: TDoublePoint);
|
||||
begin
|
||||
Unused(AIndex, ANewPos)
|
||||
end;
|
||||
|
||||
procedure TBasicChartSeries.MovePoint(
|
||||
var AIndex: Integer; const ANewPos: TPoint);
|
||||
begin
|
||||
MovePoint(AIndex, FChart.ImageToGraph(ANewPos));
|
||||
end;
|
||||
|
||||
procedure TBasicChartSeries.UpdateMargins(
|
||||
ADrawer: IChartDrawer; var AMargins: TRect);
|
||||
begin
|
||||
|
@ -269,7 +269,7 @@ type
|
||||
function GetNearestPoint(
|
||||
const AParams: TNearestPointParams;
|
||||
out AResults: TNearestPointResults): Boolean; override;
|
||||
procedure MovePoint(var AIndex: Integer; const ANewPos: TPoint); override;
|
||||
procedure MovePoint(var AIndex: Integer; const ANewPos: TDoublePoint); override;
|
||||
|
||||
published
|
||||
property Active default true;
|
||||
@ -710,21 +710,17 @@ begin
|
||||
Result := FPen.Color;
|
||||
end;
|
||||
|
||||
procedure TConstantLine.MovePoint(var AIndex: Integer; const ANewPos: TPoint);
|
||||
procedure TConstantLine.MovePoint(
|
||||
var AIndex: Integer; const ANewPos: TDoublePoint);
|
||||
begin
|
||||
Unused(AIndex);
|
||||
if LineStyle = lsVertical then
|
||||
Position := GraphToAxisX(FChart.XImageToGraph(ANewPos.X))
|
||||
else
|
||||
Position := GraphToAxisX(FChart.YImageToGraph(ANewPos.Y));
|
||||
Position :=
|
||||
GraphToAxisX(TDoublePointBoolArr(ANewPos)[LineStyle = lsHorizontal]);
|
||||
end;
|
||||
|
||||
procedure TConstantLine.SavePosToCoord(var APoint: TDoublePoint);
|
||||
begin
|
||||
if LineStyle = lsVertical then
|
||||
APoint.X := Position
|
||||
else
|
||||
APoint.Y := Position;
|
||||
TDoublePointBoolArr(APoint)[LineStyle = lsHorizontal] := Position;
|
||||
end;
|
||||
|
||||
procedure TConstantLine.SetArrow(AValue: TChartArrow);
|
||||
|
Loading…
Reference in New Issue
Block a user