mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:59:20 +02:00
TAChart: Fix SIGFPE with incorrect values of Intervals.NiceSteps
git-svn-id: trunk@32364 -
This commit is contained in:
parent
a31b96ae04
commit
4c3a22cbc2
@ -200,6 +200,7 @@ procedure TIntervalChartSource.CalculateIntervals(
|
|||||||
m, start: Double;
|
m, start: Double;
|
||||||
mi, prev, cnt: Integer;
|
mi, prev, cnt: Integer;
|
||||||
begin
|
begin
|
||||||
|
if AStep <= 0 then exit;
|
||||||
start := Int(AParams.FMin / AStep) * AStep;
|
start := Int(AParams.FMin / AStep) * AStep;
|
||||||
m := start;
|
m := start;
|
||||||
prev := AParams.ToImage(m);
|
prev := AParams.ToImage(m);
|
||||||
@ -232,7 +233,7 @@ begin
|
|||||||
while s >= Max(AParams.CountToStep(maxCount), AParams.FMinStep) do begin
|
while s >= Max(AParams.CountToStep(maxCount), AParams.FMinStep) do begin
|
||||||
for sv in Params.StepValues do
|
for sv in Params.StepValues do
|
||||||
TryStep(s * sv, bestCount);
|
TryStep(s * sv, bestCount);
|
||||||
// We are not required to pick best count, so any one will do.
|
// We are not required to pick the best count, so any one will do.
|
||||||
if not (aipUseCount in Params.Options) and (bestCount > 0) then break;
|
if not (aipUseCount in Params.Options) and (bestCount > 0) then break;
|
||||||
s *= 0.1;
|
s *= 0.1;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user