From 29ff55c51f0bc9bd0f883f08c40d2b60bd4e35a1 Mon Sep 17 00:00:00 2001 From: maxim Date: Mon, 12 Jan 2015 23:35:28 +0000 Subject: [PATCH] Merged revision(s) 47367 #d95e033212 from trunk: TAChart: Avoid TBubbleSeries crashing if X/Y/R is NaN ........ git-svn-id: branches/fixes_1_4@47368 - --- components/tachart/tamultiseries.pas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/tachart/tamultiseries.pas b/components/tachart/tamultiseries.pas index a8f6b5e6d4..4f75360a05 100644 --- a/components/tachart/tamultiseries.pas +++ b/components/tachart/tamultiseries.pas @@ -385,15 +385,22 @@ begin if Source.YCount < 2 then exit; r := 0; for i := 0 to Count - 1 do - r := Max(Source[i]^.YList[0], r); + if IsNaN(Source[i]^.YList[0]) then + continue + else + r := Max(Source[i]^.YList[0], r); with ParentChart.CurrentExtent do PrepareGraphPoints(DoubleRect(a.X - r, a.Y - r, b.X + r, b.Y + r), true); ADrawer.Pen := BubblePen; ADrawer.Brush := BubbleBrush; for i := 0 to High(FGraphPoints) do begin + if IsNaN(FGraphPoints[i].X) or IsNaN(FGraphPoints[i].Y) then + Continue; pt := ParentChart.GraphToImage(FGraphPoints[i]); pi := Source[i + FLoBound]; r := pi^.YList[0]; + if IsNaN(r) then + Continue; d.X := ParentChart.XGraphToImage(r) - ParentChart.XGraphToImage(0); d.Y := ParentChart.YGraphToImage(r) - ParentChart.YGraphToImage(0); if bocPen in OverrideColor then @@ -415,6 +422,7 @@ begin for i := 0 to Count - 1 do with Source[i]^ do begin r := YList[0]; + if IsNaN(X) or IsNaN(Y) or IsNaN(r) then continue; Result.a.X := Min(Result.a.X, X - r); Result.b.X := Max(Result.b.X, X + r); Result.a.Y := Min(Result.a.Y, Y - r);