Hacky mouse editor fix (fixes #1367)

This commit is contained in:
def 2019-01-11 10:02:15 +01:00
parent f05c56d6ce
commit 9b88d8f418

View file

@ -6051,17 +6051,19 @@ void CEditor::UpdateAndRender()
m_OldMouseY = ty;
#else
UI()->ConvertMouseMove(&rx, &ry);
// TODO: Why do we have to halve this?
rx /= 2;
ry /= 2;
m_MouseDeltaX = rx;
m_MouseDeltaY = ry;
if(!m_LockMouse)
{
s_MouseX += rx;
s_MouseY += ry;
s_MouseX = clamp(s_MouseX + rx, 0.0f, UI()->Screen()->w);
s_MouseY = clamp(s_MouseY + ry, 0.0f, UI()->Screen()->h);
}
s_MouseX = clamp(s_MouseX, 0.0f, UI()->Screen()->w);
s_MouseY = clamp(s_MouseY, 0.0f, UI()->Screen()->h);
#endif
// update the ui