From a0e04b599e34a9b7f9619e5094a8cfe7d9dfb6c2 Mon Sep 17 00:00:00 2001 From: Kate M Date: Tue, 12 Mar 2024 17:15:24 -0400 Subject: [PATCH] Fixing a drawing issue on Android where the screen size does not match the render output, we need to ignore that and just act like the render output is the screen size. --- src/third-party/imgui/imgui_impl_sdl2.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/third-party/imgui/imgui_impl_sdl2.cpp b/src/third-party/imgui/imgui_impl_sdl2.cpp index d28f879b6b9bd..0ab73ec3e82e7 100644 --- a/src/third-party/imgui/imgui_impl_sdl2.cpp +++ b/src/third-party/imgui/imgui_impl_sdl2.cpp @@ -621,9 +621,13 @@ void ImGui_ImplSDL2_NewFrame() SDL_GetRendererOutputSize(bd->Renderer, &display_w, &display_h); else SDL_GL_GetDrawableSize(bd->Window, &display_w, &display_h); +#if defined(__ANDROID__) + io.DisplaySize = ImVec2((float)display_w, (float)display_h); +#else io.DisplaySize = ImVec2((float)w, (float)h); if (w > 0 && h > 0) io.DisplayFramebufferScale = ImVec2((float)display_w / w, (float)display_h / h); +#endif // Setup time step (we don't use SDL_GetTicks() because it is using millisecond resolution) // (Accept SDL_GetPerformanceCounter() not returning a monotonically increasing value. Happens in VMs and Emscripten, see #6189, #6114, #3644)