From 4b17b59c535b375ca2427c307b3a0735fe30817c Mon Sep 17 00:00:00 2001 From: ask Date: Mon, 24 Sep 2012 14:58:22 +0000 Subject: [PATCH] TAChart: Fix TCustomChartSource.FindBounds for the case of extremely large bounds git-svn-id: trunk@38813 - --- components/tachart/tacustomsource.pas | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/components/tachart/tacustomsource.pas b/components/tachart/tacustomsource.pas index f21babc1a6..2f9701088f 100644 --- a/components/tachart/tacustomsource.pas +++ b/components/tachart/tacustomsource.pas @@ -693,11 +693,17 @@ begin end else begin ALB := 0; - while (ALB < Count) and (NumberOr(Item[ALB]^.X, AXMin - 1) < AXMin) do - Inc(ALB); + while ALB < Count do begin + with Item[ALB]^ do + if not IsNan(X) and (X >= AXMin) then break; + ALB += 1; + end; AUB := Count - 1; - while (AUB >= 0) and (NumberOr(Item[AUB]^.X, AXMax + 1) > AXMax) do - Dec(AUB); + while AUB >= 0 do begin + with Item[AUB]^ do + if not IsNan(X) and (X <= AXMax) then break; + AUB -= 1; + end; end; end;