1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-18 01:14:19 +00:00
This commit is contained in:
Marcus Kammarfelt 2025-11-22 07:57:27 -05:00 committed by GitHub
commit 769449d3f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;