mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-18 00:21:42 +02:00
TAChart: Fix missing minor ticks when an axis is inverted by means of a linear axis transform. Issue #39546.
This commit is contained in:
parent
4b54284cc7
commit
b8f2e92f03
@ -579,6 +579,8 @@ procedure TChartAxis.Draw;
|
|||||||
j: Integer;
|
j: Integer;
|
||||||
minorMarks: TChartValueTextArray;
|
minorMarks: TChartValueTextArray;
|
||||||
m: TChartValueText;
|
m: TChartValueText;
|
||||||
|
isFlipped: Boolean;
|
||||||
|
trMin, trMax: Double;
|
||||||
begin
|
begin
|
||||||
if IsNan(AMin) or (AMin = AMax) then exit;
|
if IsNan(AMin) or (AMin = AMax) then exit;
|
||||||
for j := 0 to Minors.Count - 1 do begin
|
for j := 0 to Minors.Count - 1 do begin
|
||||||
@ -587,10 +589,15 @@ procedure TChartAxis.Draw;
|
|||||||
with FHelper.Clone do
|
with FHelper.Clone do
|
||||||
try
|
try
|
||||||
FAxis := Minors[j];
|
FAxis := Minors[j];
|
||||||
|
trMin := FAxisTransf(AMin);
|
||||||
|
trMax := FAxisTransf(AMax);
|
||||||
// Only draw minor marks strictly inside the major mark interval.
|
// Only draw minor marks strictly inside the major mark interval.
|
||||||
FValueMin := Max(FAxisTransf(AMin), FValueMin);
|
isFlipped := (AMin < AMax) and (trMin > trMax);
|
||||||
FValueMax := Min(FAxisTransf(AMax), FValueMax);
|
FValueMin := Max(trMin, FValueMin);
|
||||||
if FValueMax <= FValueMin then
|
FValueMax := Min(trMax, FValueMax);
|
||||||
|
if (not isFlipped and (FValueMax <= FValueMin)) or
|
||||||
|
(isFlipped and (FValueMax >= FValueMin))
|
||||||
|
then
|
||||||
continue;
|
continue;
|
||||||
ExpandRange(FValueMin, FValueMax, -EPS);
|
ExpandRange(FValueMin, FValueMax, -EPS);
|
||||||
FClipRangeDelta := 1;
|
FClipRangeDelta := 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user