mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 04:29:25 +02:00
TAChart: Extract TChartRange.Intersect helper procedure
git-svn-id: trunk@32801 -
This commit is contained in:
parent
82df2f14a7
commit
274955e748
@ -540,12 +540,7 @@ begin
|
||||
FValueMin := GetTransform.GraphToAxis(FValueMin);
|
||||
FValueMax := GetTransform.GraphToAxis(FValueMax);
|
||||
EnsureOrder(FValueMin, FValueMax);
|
||||
with Marks.Range do begin
|
||||
if UseMin then
|
||||
FValueMin := Math.Max(Min, FValueMin);
|
||||
if UseMax then
|
||||
FValueMax := Math.Min(Max, FValueMax);
|
||||
end;
|
||||
Marks.Range.Intersect(FValueMin, FValueMax);
|
||||
d := MakeValuesInRangeParams(FValueMin, FValueMax);
|
||||
FValueMin := GetTransform.AxisToGraph(FValueMin);
|
||||
FValueMax := GetTransform.AxisToGraph(FValueMax);
|
||||
|
@ -320,6 +320,7 @@ type
|
||||
public
|
||||
procedure Assign(ASource: TPersistent); override;
|
||||
procedure CheckBoundsOrder;
|
||||
procedure Intersect(var AMin, AMax: Double);
|
||||
published
|
||||
property Max: Double index 2 read GetBounds write SetBounds stored IsBoundsStored;
|
||||
property Min: Double index 1 read GetBounds write SetBounds stored IsBoundsStored;
|
||||
@ -1064,6 +1065,14 @@ begin
|
||||
Result := FUseBounds[AIndex];
|
||||
end;
|
||||
|
||||
procedure TChartRange.Intersect(var AMin, AMax: Double);
|
||||
begin
|
||||
if UseMin and (Min > AMin) then
|
||||
AMin := Min;
|
||||
if UseMax and (Max < AMax)then
|
||||
AMax := Max;
|
||||
end;
|
||||
|
||||
function TChartRange.IsBoundsStored(AIndex: Integer): Boolean;
|
||||
begin
|
||||
Result := FBounds[AIndex] <> 0;
|
||||
|
Loading…
Reference in New Issue
Block a user