Fixed scaling of mouse position for mouse wheel event handling in imgui on Retina monitors

This commit is contained in:
enricoturri1966 2020-11-02 10:17:28 +01:00
parent 3ec057bef7
commit 38e883a66e

View File

@ -3348,17 +3348,17 @@ void GLCanvas3D::on_mouse_wheel(wxMouseEvent& evt)
if (evt.MiddleIsDown()) if (evt.MiddleIsDown())
return; return;
if (wxGetApp().imgui()->update_mouse_data(evt)) {
m_dirty = true;
return;
}
#if ENABLE_RETINA_GL #if ENABLE_RETINA_GL
const float scale = m_retina_helper->get_scale_factor(); const float scale = m_retina_helper->get_scale_factor();
evt.SetX(evt.GetX() * scale); evt.SetX(evt.GetX() * scale);
evt.SetY(evt.GetY() * scale); evt.SetY(evt.GetY() * scale);
#endif #endif
if (wxGetApp().imgui()->update_mouse_data(evt)) {
m_dirty = true;
return;
}
#ifdef __WXMSW__ #ifdef __WXMSW__
// For some reason the Idle event is not being generated after the mouse scroll event in case of scrolling with the two fingers on the touch pad, // For some reason the Idle event is not being generated after the mouse scroll event in case of scrolling with the two fingers on the touch pad,
// if the event is not allowed to be passed further. // if the event is not allowed to be passed further.