Skip to content

Commit

Permalink
Fixing a drawing issue on Android where the screen size does not matc…
Browse files Browse the repository at this point in the history
…h the render output, we need to ignore that and just act like the render output is the screen size.
  • Loading branch information
katemonster33 committed Mar 12, 2024
1 parent 1a9b9c0 commit a0e04b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/third-party/imgui/imgui_impl_sdl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a0e04b5

Please sign in to comment.