forked from Mirrors/openclonk
C4Viewport: Don't apply zoom limits if viewport not owned or editor mode
parent
b4157c5ec9
commit
0876e89f3a
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue