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