Fixed FOV bug caused by a floating point precision issue when using Shift + Left drag

ver1_5_1
Vincent Giangiulio 2007-10-22 21:42:50 +00:00
parent 2cbc245ab7
commit 7caa39c106
1 changed files with 6 additions and 8 deletions

View File

@ -936,18 +936,16 @@ void CelestiaCore::mouseMove(float dx, float dy, int modifiers)
float maxFOV = MaximumFOV;
float fov = sim->getActiveObserver()->getFOV();
if (fov < minFOV)
fov = minFOV;
// In order for the zoom to have the right feel, it should be
// exponential.
float newFOV = minFOV + (float) exp(log(fov - minFOV) + amount * 4);
if (newFOV < minFOV)
newFOV = minFOV;
else if (newFOV > maxFOV)
if (newFOV > maxFOV)
newFOV = maxFOV;
sim->getActiveObserver()->setFOV(newFOV);
setZoomFromFOV();
if (newFOV > minFOV)
{
sim->getActiveObserver()->setFOV(newFOV);
setZoomFromFOV();
}
if ((renderer->getRenderFlags() & Renderer::ShowAutoMag))
{