mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Fonts: Allowing PushFont()/PopFont() to be called outside the imgui frame scope. (#3621)
This commit is contained in:
parent
d30e102f3a
commit
61d4bf95dc
2 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue