mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 14:22:29 +01:00
TAChart: Use EnsureOrder and NormalizeRect throughout the code
git-svn-id: trunk@25919 -
This commit is contained in:
parent
89e0f1b9ba
commit
d6b37e7cb4
@ -485,8 +485,7 @@ var
|
||||
begin
|
||||
AMin := GetTransform.GraphToAxis(AMin);
|
||||
AMax := GetTransform.GraphToAxis(AMax);
|
||||
if AMin > AMax then
|
||||
Exchange(AMin, AMax);
|
||||
EnsureOrder(AMin, AMax);
|
||||
Marks.SourceDef.ValuesInRange(
|
||||
AMin, AMax, Marks.Format, IsVertical, FMarkValues, FMarkTexts);
|
||||
if Inverted then
|
||||
|
||||
@ -558,8 +558,8 @@ function RectIntersectsRect(
|
||||
|
||||
function RangesIntersect(L1, R1, L2, R2: Double; out L, R: Double): Boolean;
|
||||
begin
|
||||
if L1 > R1 then Exchange(L1, R1);
|
||||
if L2 > R2 then Exchange(L2, R2);
|
||||
EnsureOrder(L1, R1);
|
||||
EnsureOrder(L2, R2);
|
||||
L := Max(L1, L2);
|
||||
R := Min(R1, R2);
|
||||
Result := L <= R;
|
||||
|
||||
@ -1021,7 +1021,7 @@ procedure TChart.UpdateExtent;
|
||||
AHi += DEFAULT_WIDTH / 2;
|
||||
end
|
||||
else begin
|
||||
if ALo > AHi then Exchange(ALo, AHi);
|
||||
EnsureOrder(ALo, AHi);
|
||||
// Expand view slightly to avoid data points on the chart edge.
|
||||
ExpandRange(ALo, AHi, ExpandPercentage * PERCENT);
|
||||
end;
|
||||
|
||||
@ -659,12 +659,7 @@ begin
|
||||
ext.a := FChart.ImageToGraph(TopLeft);
|
||||
ext.b := FChart.ImageToGraph(BottomRight);
|
||||
end;
|
||||
with ext do begin
|
||||
if a.X > b.X then
|
||||
Exchange(a.X, b.X);
|
||||
if a.Y > b.Y then
|
||||
Exchange(a.Y, b.Y);
|
||||
end;
|
||||
NormalizeRect(ext);
|
||||
CheckProportions;
|
||||
FChart.LogicalExtent := ext;
|
||||
Handled;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user