TAChart: Fix incorrect IsFewPoints() of TCubicSplineSeries.Spline (introduced by r60809 #0c695d9c39). Issue #35268, patch by Marcin Wiazowski.

git-svn-id: trunk@60819 -
This commit is contained in:
wp 2019-04-02 04:46:07 +00:00
parent 43e2ae0cf6
commit 09a76c0d2d

View File

@ -1271,7 +1271,7 @@ end;
function TCubicSplineSeries.TSpline.IsFewPoints: Boolean;
begin
Result := Length(FOwner.FX) < 2;
Result := (FLastCacheIndex <= FFirstCacheIndex); // less than 2 points
end;
function TCubicSplineSeries.TSpline.PrepareCoeffs(ASource: TCustomChartSource;
@ -1296,7 +1296,7 @@ begin
ASourceIndex += 1;
end;
FLastCacheIndex := ACacheIndex - 1;
if FLastCacheIndex = FFirstCacheIndex then exit(false);
if FLastCacheIndex < FFirstCacheIndex then exit(false); // No points
if IsFewPoints then exit(true);
ok := 0;
n := ACacheIndex - FFirstCacheIndex;
@ -1418,7 +1418,7 @@ begin
if SplineType = cstHermiteMonotone then
exit;
if not (FCachedExtent = EmptyExtent) then begin
if (FCachedExtent <> EmptyExtent) then begin
Result := FCachedExtent;
exit;
end;