mirror of
https://github.com/ocornut/imgui.git
synced 2025-04-07 22:43:09 +00:00
Merge 6c21bc52eb
into d467950a5e
This commit is contained in:
commit
f5a72df312
1 changed files with 3 additions and 0 deletions
|
@ -352,6 +352,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…
Add table
Reference in a new issue