forked from Mirrors/openclonk
Fix viewport Zoom getting set to NaN
parent
75f62e52f2
commit
eefa8749a8
|
@ -518,6 +518,8 @@ void C4Viewport::AdjustZoomAndPosition()
|
|||
// we reach ZoomTarget in finite time.
|
||||
float ZoomAdjustFactor = Z0 * pow(DeltaZoom, 1.0f / 8.0f);
|
||||
|
||||
if (Zoom == 0)
|
||||
Zoom = ZoomTarget;
|
||||
if (Zoom < ZoomTarget)
|
||||
Zoom = std::min(Zoom * ZoomAdjustFactor, ZoomTarget);
|
||||
if (Zoom > ZoomTarget)
|
||||
|
|
Loading…
Reference in New Issue