C4Viewport: Don't apply zoom limits if viewport not owned or editor mode

floating-point
Martin Plicht 2010-12-13 21:55:43 +01:00
parent b4157c5ec9
commit 0876e89f3a
1 changed files with 5 additions and 2 deletions

View File

@ -414,8 +414,11 @@ void C4Viewport::ChangeZoom(float by_factor)
void C4Viewport::SetZoom(float to_value, bool direct)
{
ZoomTarget = to_value;
if (ZoomLimitMin && ZoomTarget < ZoomLimitMin) ZoomTarget = ZoomLimitMin;
if (ZoomLimitMax && ZoomTarget > ZoomLimitMax) ZoomTarget = ZoomLimitMax;
if (Player != NO_OWNER || !::Application.isEditor)
{
if (ZoomLimitMin && ZoomTarget < ZoomLimitMin) ZoomTarget = ZoomLimitMin;
if (ZoomLimitMax && ZoomTarget > ZoomLimitMax) ZoomTarget = ZoomLimitMax;
}
// direct: Set zoom without scrolling to it
if (direct) Zoom = ZoomTarget;
}