openrails
openrails copied to clipboard
Fix TrackViewer crash on big zoom value
Hi,
My son found a little bug in the TrackViewer program. With a really big value of zoom, the program crashes due to an unhandled ArgumentException
After investigating, I have found that with a really big zoom value, the width becomes 0.0, and the result of pass zero for the value of nearPlaneDistance parameter of the Matrix.CreatePerspectiveFieldOfView method.
This PR proposed to solve this issue by returning without updating the camera when the nearPlaneDistance computed value is less or equals to zero.
Hi Fred,
Thanks for investigating this and submitting your fix.
I've added the label "for-unstable", which means that it will now be included in the automatic builds of the Unstable Version.
Your code change looks very clean, but let's leave it in Unstable for 2 weeks or so to check that there are no unwanted consequences. After that, I will approve and merge into the Testing Version ("master" branch).
Best wishes,
Chris
Hi Chris,
Thanks for the review. I've taken note of the validation process.
Best wishes.