Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1440

Summary: Invalid floating point operation occurs on repaint
Product: VCL TeeChart Reporter: Andrew <andrew.e.smith>
Component: ChartAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED WORKSFORME    
Severity: normal CC: narcis, sandra
Priority: ---    
Version: 150420   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: Line Delphi / C++ Builder RAD IDE Version: RAD XE6

Description Andrew 2016-02-17 00:01:19 EST
Don't have access to the source so can't investigate what is happening here, but occasionally users see the following exception when the Repaint() method is called on the TeeChart object:

exception class    : EInvalidOp
exception message  : Invalid floating point operation.

main thread ($41a8):
rtl200.bpl    System  @ROUND
Tee920.bpl    Vcltee  Teengine.TChartAxis.XPosValueCheck
TeePro920.bpl Vcltee  Teetools.TCursorTool.CalcScreenPositions
TeePro920.bpl Vcltee  Teetools.TCursorTool.ChartEvent
Tee920.bpl    Vcltee  Teengine.TCustomAxisPanel.BroadcastToolEvent
Tee920.bpl    Vcltee  Teengine.TCustomAxisPanel.InternalDraw
Tee920.bpl    Vcltee  Teeprocs.TCustomTeePanel.Draw
Tee920.bpl    Vcltee  Teeprocs.TCustomTeePanel.Draw
Tee920.bpl    Vcltee  Teeprocs.TCustomTeePanel.Paint
Comment 1 narcís calvet 2016-03-29 09:01:58 EDT
Can you please attach a simple example project we can run "as-is" and let us know the exact steps we should follow to reproduce the problem here? Thanks.
Comment 2 Andrew 2016-03-29 19:21:48 EDT
(In reply to narcís calvet from comment #1)
> Can you please attach a simple example project we can run "as-is" and let us
> know the exact steps we should follow to reproduce the problem here? Thanks.

I haven't been able to reproduce the issue in anything other than our main software product yet, but will keep trying. 

What does XPosValueCheck do? If I had to guess based on the call stack, it looks like my cursor tool object has got some sort of dodgy screen position being generated, which is then being passed to XPosValueCheck, which isn't catching an EInvalidOp exception thrown by System.Round. According to http://docwiki.embarcadero.com/Libraries/XE6/en/System.Round, this can occur if the resulting value is not within the int64 range...but I don't know how CalcScreenPositions works so it's difficult to know what could be happening here.
Comment 3 narcís calvet 2016-03-30 03:10:25 EDT
Hello Andrew,

Thanks for trying to produce a test case.

XPosValueCheck and YPosValueCheck perform axis calculations with overflow checking to avoid Windows GDI limits on pixel coordinates.

CalcScreenPositions calculates cursor tool screen position.