From 40d59fec0ba02a069963c61bd9b36f0b4768815b Mon Sep 17 00:00:00 2001 From: wp Date: Thu, 17 Oct 2019 22:00:28 +0000 Subject: [PATCH] TAChart: Fix chart distance tools crashing when series contains a NaN value. git-svn-id: trunk@62069 - --- components/tachart/tacustomseries.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/tachart/tacustomseries.pas b/components/tachart/tacustomseries.pas index bc3d06e563..ce68ab8052 100644 --- a/components/tachart/tacustomseries.pas +++ b/components/tachart/tacustomseries.pas @@ -1861,7 +1861,10 @@ var begin Unused(APointIdx); Unused(AXIdx, AYIdx); - pt := ParentChart.GraphToImage(AGraphPt); + if IsNaN(AGraphPt) then + pt := Point(10000, 10000) + else + pt := ParentChart.GraphToImage(AGraphPt); Result := AParams.FDistFunc(AParams.FPoint, pt); end;