mirror of
https://github.com/ocornut/imgui.git
synced 2025-10-21 17:31:45 +00:00
Fonts: Allowing PushFont()/PopFont() to be called outside the imgui frame scope. (#3621)
This commit is contained in:
@@ -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()
|
||||
@@ -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)
|
||||
|
Reference in New Issue
Block a user