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)