1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Windows: legacy SetWindowFontScale() is properly inherited by nested child windows. (#2701, #8138, #1018)

This commit is contained in:
ocornut 2025-01-16 19:07:09 +01:00
parent 4c64ba16c5
commit b7c27c5333
4 changed files with 10 additions and 3 deletions

View file

@ -4276,7 +4276,7 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* ctx, const char* name) : DrawListInst(NUL
SetWindowPosVal = SetWindowPosPivot = ImVec2(FLT_MAX, FLT_MAX);
LastFrameActive = -1;
LastTimeActive = -1.0f;
FontWindowScale = 1.0f;
FontWindowScale = FontWindowScaleParents = 1.0f;
SettingsOffset = -1;
DrawList = &DrawListInst;
DrawList->_OwnerName = Name;
@ -7037,6 +7037,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// There's little point to expose a flag to set this: because the interesting cases won't be using parent_window_in_stack,
// e.g. linking a tool window in a standalone viewport to a document window, regardless of their Begin() stack parenting. (#6798)
window->ParentWindowForFocusRoute = (flags & ImGuiWindowFlags_ChildWindow) ? parent_window_in_stack : NULL;
// Inherent SetWindowFontScale() from parent until we fix this system...
window->FontWindowScaleParents = parent_window ? parent_window->FontWindowScaleParents * parent_window->FontWindowScale : 1.0f;
}
// Add to focus scope stack