# HG changeset patch # User Wuzzy # Date 1591313403 -7200 # Node ID f0ac916a0608ed7ee8aff7697582f3dadd82b695 # Parent 46b7b2c821d096792463d9566d482e10478b2877 Fix camera zooming out too far in pause mode (bug 773) diff -r 46b7b2c821d0 -r f0ac916a0608 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Fri Jun 05 00:57:05 2020 +0200 +++ b/hedgewars/uWorld.pas Fri Jun 05 01:30:03 2020 +0200 @@ -877,6 +877,13 @@ end end; +// Force the lower camera boundary to never be lower than a few pixels below the water line +function LowerCameraBound: LongInt; +begin +LowerCameraBound:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - (cVisibleWater + trunc(CinematicBarH / (cScaleFactor / 2.0))); +if WorldDy < LowerCameraBound then + WorldDy:= LowerCameraBound; +end; procedure DrawWorld(Lag: LongInt); begin @@ -897,7 +904,9 @@ ZoomValue:= zoom; if (not isPaused) and (not isAFK) and (GameType <> gmtRecord) then - MoveCamera; + MoveCamera + else if (isPaused) then + LowerCameraBound; if cStereoMode = smNone then begin @@ -1941,9 +1950,7 @@ WorldDx:= WorldDx + rightX - leftX; end; -wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - (cVisibleWater + trunc(CinematicBarH / (cScaleFactor / 2.0))); -if WorldDy < wdy then - WorldDy:= wdy; +wdy:= LowerCameraBound; if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then exit;