diff --git a/src/game/client/components/camera.cpp b/src/game/client/components/camera.cpp index 91e6bd142..b9e083604 100644 --- a/src/game/client/components/camera.cpp +++ b/src/game/client/components/camera.cpp @@ -81,7 +81,13 @@ void CCamera::OnRender() } else { + const float OldLevel = m_Zoom; m_Zoom = m_ZoomSmoothing.Evaluate(ZoomProgress(Time)); + if((OldLevel < m_ZoomSmoothingTarget && m_Zoom > m_ZoomSmoothingTarget) || (OldLevel > m_ZoomSmoothingTarget && m_Zoom < m_ZoomSmoothingTarget)) + { + m_Zoom = m_ZoomSmoothingTarget; + m_Zooming = false; + } } m_Zoom = clamp(m_Zoom, MinZoomLevel(), MaxZoomLevel()); } diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 92032ac41..a84c4bbe7 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -6138,6 +6138,11 @@ void CEditor::UpdateZoom() else { m_Zoom = m_ZoomSmoothing.Evaluate(ZoomProgress(Time)); + if((OldLevel < m_ZoomSmoothingTarget && m_Zoom > m_ZoomSmoothingTarget) || (OldLevel > m_ZoomSmoothingTarget && m_Zoom < m_ZoomSmoothingTarget)) + { + m_Zoom = m_ZoomSmoothingTarget; + m_Zooming = false; + } } m_Zoom = clamp(m_Zoom, MinZoomLevel(), MaxZoomLevel()); if(g_Config.m_EdZoomTarget)