Skip to content

Commit

Permalink
Revert "Fonts: Allowing PushFont()/PopFont() to be called outside the…
Browse files Browse the repository at this point in the history
… imgui frame scope. (#3621)"

This reverts commit 61d4bf9.
  • Loading branch information
ocornut committed Dec 20, 2024
1 parent 61d4bf9 commit 7219fa6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ 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: 2 additions & 4 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8018,8 +8018,7 @@ void ImGui::PushFont(ImFont* font)
font = GetDefaultFont();
g.FontStack.push_back(font);
SetCurrentFont(font);
if (ImGuiWindow* window = g.CurrentWindow)
window->DrawList->_SetTextureID(font->ContainerAtlas->TexID);
g.CurrentWindow->DrawList->_SetTextureID(font->ContainerAtlas->TexID);
}

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

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

0 comments on commit 7219fa6

Please sign in to comment.