mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-06 06:25:54 +01:00
Merge 6c21bc52eb84e3979b14f9da741bed0087e193f2 into a1af3c1a59fe81f7a1cac10dcead0a383b99f245
This commit is contained in:
commit
dbbcf852e4
@ -391,6 +391,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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user