Skip to content

Commit

Permalink
Fonts: Allowing PushFont()/PopFont() to be called outside the imgui f…
Browse files Browse the repository at this point in the history
…rame scope. (#3621)
  • Loading branch information
ocornut committed Dec 20, 2024
1 parent d30e102 commit 61d4bf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Other changes:
yourself based on your own logic. (#8223)
- Nav: Fixed an issue where Alt key would clear current active item on
windows with the ImGuiWindowFlags_NoNavInputs flag. (#8231)
- Fonts: Allowing PushFont()/PopFont() to be called outside the imgui frame scope. (#3621)
- Debug Tools: Debug Log: hovering 0xXXXXXXXX values in log is allowed even
if a popup is blocking mouse access to the debug log window. (#5855)
- Backends: Vulkan: Fixed setting VkSwapchainCreateInfoKHR::preTransform for
Expand Down
6 changes: 4 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8018,7 +8018,8 @@ void ImGui::PushFont(ImFont* font)
font = GetDefaultFont();
g.FontStack.push_back(font);
SetCurrentFont(font);
g.CurrentWindow->DrawList->_SetTextureID(font->ContainerAtlas->TexID);
if (ImGuiWindow* window = g.CurrentWindow)
window->DrawList->_SetTextureID(font->ContainerAtlas->TexID);
}

void ImGui::PopFont()
Expand All @@ -8032,7 +8033,8 @@ void ImGui::PopFont()
g.FontStack.pop_back();
ImFont* font = g.FontStack.Size == 0 ? GetDefaultFont() : g.FontStack.back();
SetCurrentFont(font);
g.CurrentWindow->DrawList->_SetTextureID(font->ContainerAtlas->TexID);
if (ImGuiWindow* window = g.CurrentWindow)
window->DrawList->_SetTextureID(font->ContainerAtlas->TexID);
}

void ImGui::PushItemFlag(ImGuiItemFlags option, bool enabled)
Expand Down

0 comments on commit 61d4bf9

Please sign in to comment.