Viewports: fixed viewport->Framebuffer not being state on platform on backend where Platform_GetWindowFramebufferScale (value was only applied to DrawData).

This commit is contained in:
ocornut
2026-08-04 14:02:53 +02:00
parent b48d1afbe8
commit 98a66d8c88
+2 -1
View File
@@ -6177,7 +6177,7 @@ static void InitViewportDrawData(ImGuiViewportP* viewport)
draw_data->TotalVtxCount = draw_data->TotalIdxCount = 0;
draw_data->DisplayPos = viewport->Pos;
draw_data->DisplaySize = is_minimized ? ImVec2(0.0f, 0.0f) : viewport->Size;
draw_data->FramebufferScale = (viewport->FramebufferScale.x != 0.0f) ? viewport->FramebufferScale : g.IO.DisplayFramebufferScale;
draw_data->FramebufferScale = viewport->FramebufferScale;
draw_data->OwnerViewport = viewport;
draw_data->Textures = &g.PlatformIO.Textures;
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
@@ -17411,6 +17411,7 @@ ImGuiViewportP* ImGui::AddUpdateViewport(ImGuiWindow* window, ImGuiID id, const
}
viewport->Window = window;
viewport->FramebufferScale = g.IO.DisplayFramebufferScale; // Later overidden by Platform_GetWindowFramebufferScale() for platform having it
viewport->LastFrameActive = g.FrameCount;
viewport->UpdateWorkRect();
IM_ASSERT(window == NULL || viewport->ID == window->ID);