diff --git a/backends/imgui_impl_sdl3.cpp b/backends/imgui_impl_sdl3.cpp index 815929595..e080b7a02 100644 --- a/backends/imgui_impl_sdl3.cpp +++ b/backends/imgui_impl_sdl3.cpp @@ -386,6 +386,9 @@ bool ImGui_ImplSDL3_ProcessEvent(const SDL_Event* event) if (ImGui_ImplSDL3_GetViewportForWindowID(event->motion.windowID) == nullptr) return false; ImVec2 mouse_pos((float)event->motion.x, (float)event->motion.y); + SDL_GetRenderScale(bd->Renderer, &scaleX, &scaleY); + mouse_pos.x *= scaleX; + mouse_pos.y *= scaleY; io.AddMouseSourceEvent(event->motion.which == SDL_TOUCH_MOUSEID ? ImGuiMouseSource_TouchScreen : ImGuiMouseSource_Mouse); io.AddMousePosEvent(mouse_pos.x, mouse_pos.y); return true;