[Bug report] Division by 0 in TTeeCanvas3D.CalcPerspective

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
bertrod
Advanced
Posts: 151
Joined: Wed Sep 07, 2005 4:00 am

[Bug report] Division by 0 in TTeeCanvas3D.CalcPerspective

Post by bertrod » Thu Jul 27, 2006 12:10 pm

Hello,

I noticed a bug in a very particular situation :
I'm using a TeeTree near a TSplitter. The bug occurs only if there is a vertical scrollbar.

When I move my splitter, the error happens if the TeeTree width is exactly the size of the Scrollbar. This causes that the TeeTree width is 0 (because the srollbar takes the rest of the place).

In the file TeCanvas, function TTeeCanvas3D.CalcPerspective, there is a division :

Code: Select all

IZoomPerspec:=IZoomFactor*F3DOptions.Perspective*PerspecFactor/(Rect.Right-Rect.Left)
In the case I'm describing, the Rect.Right and Rect.Left are equal to 0, and this causes a DivisionByZero error.

To solve it, I had to add a test :

Code: Select all

if not ((Rect.Right = 0) and (Rect.Left = 0)) then ...
I hope you can correct it in the further releases.

Greets

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Mon Jul 31, 2006 10:26 am

Hi Bertrod,

Thanks for your bug-report and possible solution.

This bug should been fixed already in the latest release of teeChart. Which version of teeChart Pro are you using?

Regards,
Tom.

bertrod
Advanced
Posts: 151
Joined: Wed Sep 07, 2005 4:00 am

Post by bertrod » Mon Jul 31, 2006 11:17 am

Version 7.04. Sorry if the bug has been corrected since this version. :oops:

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Mon Jul 31, 2006 12:19 pm

Hi Bertrod,

You can download version 7.07 from our website. This version has a fix for the bug you mentioned.

Thanks again for reporting us this bug (even if it was already taken into account in a newer version)

Regards,
Tom.

Post Reply