Skip to content

Commit

Permalink
Merge pull request ddnet#7004 from Vy0x2/pr-poc-mv-clean
Browse files Browse the repository at this point in the history
Fix smooth zoom with zero causing problems with multiview
  • Loading branch information
def- authored Aug 12, 2023
2 parents fcb05f9 + 9db53bd commit 84c6cf2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game/client/components/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ float CCamera::ZoomProgress(float CurrentTime) const
void CCamera::ScaleZoom(float Factor)
{
float CurrentTarget = m_Zooming ? m_ZoomSmoothingTarget : m_Zoom;
ChangeZoom(CurrentTarget * Factor, g_Config.m_ClSmoothZoomTime);
ChangeZoom(CurrentTarget * Factor, m_pClient->m_Snap.m_SpecInfo.m_Active && GameClient()->m_MultiViewActivated ? g_Config.m_ClMultiViewZoomSmoothness : g_Config.m_ClSmoothZoomTime);
}

float CCamera::MaxZoomLevel()
Expand Down Expand Up @@ -225,7 +225,7 @@ void CCamera::ConZoom(IConsole::IResult *pResult, void *pUserData)
{
CCamera *pSelf = (CCamera *)pUserData;
float TargetLevel = pResult->NumArguments() ? pResult->GetFloat(0) : g_Config.m_ClDefaultZoom;
pSelf->ChangeZoom(std::pow(ZoomStep, TargetLevel - 10), g_Config.m_ClSmoothZoomTime);
pSelf->ChangeZoom(std::pow(ZoomStep, TargetLevel - 10), pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active && pSelf->GameClient()->m_MultiViewActivated ? g_Config.m_ClMultiViewZoomSmoothness : g_Config.m_ClSmoothZoomTime);

if(pSelf->GameClient()->m_MultiViewActivated)
pSelf->GameClient()->m_MultiViewPersonalZoom = 0;
Expand Down

0 comments on commit 84c6cf2

Please sign in to comment.