[Bug report] Division by 0 in TTeeCanvas3D.CalcPerspective
Posted: 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 :
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 :
I hope you can correct it in the further releases.
Greets
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)
To solve it, I had to add a test :
Code: Select all
if not ((Rect.Right = 0) and (Rect.Left = 0)) then ...
Greets