Recent

Author Topic: [fixed] Invalid floating point operation with DataPointMarksClickTool  (Read 177 times)

Muso

  • Sr. Member
  • ****
  • Posts: 356
I use the new DataPointMarksClickTool and encounter a bug which I cannot prevent. So I am looking for a method to prevent the Invalid floating point operation:
* take the attached example (this is a bit bigger because on a new project I get another error)
* run the program in debug mode and Ctrl-left-click into the chart on a position where no data is
result: FLT INVALID OPERATION in this line of TACustomSeries.pas:

Code: Pascal  [Select][+][-]
  1. centerLvl := AxisToGraphY((ext.a.y + ext.b.y) * 0.5);
Lazarus 2.3.0 (rev main-2_3-2941-g84f716a2ff)
FPC 3.2.2
x86_64-win64-win32/win64
The error is triggered because the extent is infinite. The error only occurs when one clicks at a position without data in the chart. However, I cannot find a method to check this before the error is triggered.
I can of course modify TACustomSeries.pas but on the next FPCupDeluxe update this will be overwritten.
« Last Edit: November 28, 2022, 08:18:23 pm by Muso »

KodeZwerg

  • Hero Member
  • *****
  • Posts: 878
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Invalid floating point operation with DataPointMarksClickTool
« Reply #1 on: November 28, 2022, 05:13:41 pm »
Something I do miss  :'(
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

wp

  • Hero Member
  • *****
  • Posts: 10462
Re: Invalid floating point operation with DataPointMarksClickTool
« Reply #2 on: November 28, 2022, 07:19:30 pm »
FLT INVALID OPERATION
Fixed in commit bb65b8022c848ecf86806d56f1f574f7a8b8ea96.

Something I do miss  :'(
This is a new chart tool scheduled for v2.4 (https://wiki.freepascal.org/Lazarus_2.4.0_release_notes#TAChart), it is not contained in v2.2.4

Muso

  • Sr. Member
  • ****
  • Posts: 356
Re: Invalid floating point operation with DataPointMarksClickTool
« Reply #3 on: November 28, 2022, 08:18:11 pm »
Fixed in commit bb65b8022c848ecf86806d56f1f574f7a8b8ea96.
Many thanks! Confirmed fixed.

 

TinyPortal © 2005-2018