diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index fd48e5e1c..03eb9ed1c 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -109,6 +109,8 @@ Other Changes: - Angled Headers: angled section for column being reordered via the regular headers stays highlighted during reordering. - Style: + - Fonts: fixed an issue introduced in 1.92.6 where style.FontBaseSize would be + cleared during the first frame if no fonts was explicitely added before. - Border sizes are now scaled (and rounded) by ScaleAllSizes(). - When using large values with ScallAllSizes(), the following items thickness are scaled to integer amounts: diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 680d6af02..085f9f11c 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -3258,7 +3258,9 @@ void ImFontAtlasBuildNotifySetFont(ImFontAtlas* atlas, ImFont* old_font, ImFont* shared_data->Font = new_font; if (ImGuiContext* ctx = shared_data->Context) { - if (ctx->FrameCount == 0 && old_font == NULL) // While this should work either way, we save ourselves the bother / debugging confusion of running ImGui code so early when it is not needed. + // While this should work either way, we save ourselves the bother / debugging confusion of running ImGui code so early when it is not needed. + // Also fixes erroneously rewriting style.FontSizeBase during init if adding default fonts. + if (old_font == NULL && ctx->Font == NULL && ctx->FontSizeBase == 0.0f) continue; if (ctx->IO.FontDefault == old_font)