Merge pull request #8766 from Matodor/pr_inputs_missing_zoom_scale

Fixed missing TargetX/TargetY zoom scale apply in CControls::SnapInput
This commit is contained in:
Dennis Felsing 2024-08-19 06:55:54 +00:00 committed by GitHub
commit 89cc2d46a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -211,6 +211,13 @@ int CControls::SnapInput(int *pData)
m_aInputData[g_Config.m_ClDummy].m_TargetX = (int)m_aMousePos[g_Config.m_ClDummy].x; m_aInputData[g_Config.m_ClDummy].m_TargetX = (int)m_aMousePos[g_Config.m_ClDummy].x;
m_aInputData[g_Config.m_ClDummy].m_TargetY = (int)m_aMousePos[g_Config.m_ClDummy].y; m_aInputData[g_Config.m_ClDummy].m_TargetY = (int)m_aMousePos[g_Config.m_ClDummy].y;
// scale TargetX, TargetY by zoom.
if(!m_pClient->m_Snap.m_SpecInfo.m_Active)
{
m_aInputData[g_Config.m_ClDummy].m_TargetX *= m_pClient->m_Camera.m_Zoom;
m_aInputData[g_Config.m_ClDummy].m_TargetY *= m_pClient->m_Camera.m_Zoom;
}
// send once a second just to be sure // send once a second just to be sure
Send = Send || time_get() > m_LastSendTime + time_freq(); Send = Send || time_get() > m_LastSendTime + time_freq();
} }