[client] imgui: support high DPI by scaling framebuffer

This allows overlays to render at correct positions on high DPI displays.
This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-07-23 16:07:42 +10:00
1 parent 56308fcbd1
commit b5c5ecc074
2 files changed
+13 -3

No files matched your search

+5 -3
View File
@@ -179,12 +179,14 @@ static int renderThread(void * unused)
int resize = atomic_load(&g_state.lgrResize);
if (resize)
{
const ImVec2 displaySize =
{
g_state.io->DisplaySize = (ImVec2) {
.x = g_state.windowW,
.y = g_state.windowH
};
g_state.io->DisplaySize = displaySize;
g_state.io->DisplayFramebufferScale = (ImVec2) {
.x = g_state.windowScale,
.y = g_state.windowScale,
};
if (g_state.lgr)
g_state.lgr->on_resize(g_state.lgrData, g_state.windowW, g_state.windowH,