GetMouseState dont calculate for scaling SDL3
Problem
When using SDL3_Renderer with SDL_SetREnderScale the mouse cordinates that is recived throught event->motion.x and event->motion.y dont account for scaling offset.
Solution
Before io.AddMousePosEvent the scalefactor is applied to the mouse cordinates
Changes
ImGui_ImplSDL3_ProcessEvent now fetches the scaling and apply it to the mouse cordinates.
I am rather puzzled by this. You are highlighting a real problem if using SDL_SetRenderScale() but it seems like absolutely nothing in this PR was tested?
- Variables scaleX/scaleY are not declared.
- The correct formula here seems to a divide rather than a multiply.
- There is also call to
AddMousePosEvent()inImGui_ImplSDL3_UpdateMouseData()which hasn't been scaled. -
bd->Renderermay be NULL on other backends. - The
io.WantSetMousePospath has not been handled.
I can't comprehend how this would have possibly worked on our end. Could you clarify?
Also see https://wiki.libsdl.org/SDL3/SDL_ConvertEventToRenderCoordinates