Internals: added FontScale storage (amend 0f63d3e).

This commit is contained in:
ocornut 2024-07-02 17:45:12 +02:00
parent 5496050f5f
commit 05a4f28059
2 changed files with 2 additions and 2 deletions

View File

@ -7510,7 +7510,7 @@ void ImGui::SetCurrentFont(ImFont* font)
g.Font = font;
g.FontBaseSize = ImMax(1.0f, g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale);
g.FontSize = g.CurrentWindow ? g.CurrentWindow->CalcFontSize() : 0.0f;
g.FontScale = g.FontSize / g.FontSize;
g.FontScale = g.FontSize / g.Font->FontSize;
ImFontAtlas* atlas = g.Font->ContainerAtlas;
g.DrawListSharedData.TexUvWhitePixel = atlas->TexUvWhitePixel;

View File

@ -2267,7 +2267,7 @@ struct ImGuiContext
Initialized = false;
FontAtlasOwnedByContext = shared_font_atlas ? false : true;
Font = NULL;
FontSize = FontBaseSize = CurrentDpiScale = 0.0f;
FontSize = FontBaseSize = FontScale = CurrentDpiScale = 0.0f;
IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)();
Time = 0.0f;
FrameCount = 0;