diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 21008e01d..049007155 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -50,6 +50,9 @@ Other Changes: specified but the target font doesn't. Usually either all fonts should have a reference size (only required when specifying e.g. GlyphOffset), or none should have a reference size. +- Fonts: fixed a crash when changing texture format when using a legacy + backend. Most commonly would happen when calling GetTexDataAsRGBA32() + then immediately GetTexDataAsAlpha8(). (#8824) - Windows: fixed an issue where resizable child windows would emit border logic when hidden/non-visible (e.g. when in a docked window that is not selected), impacting code not checking for BeginChild() return value. (#8815) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index ca1f912a4..8109ca6e0 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -3363,11 +3363,7 @@ void ImFontAtlasBuildMain(ImFontAtlas* atlas) { IM_ASSERT(!atlas->Locked && "Cannot modify a locked ImFontAtlas!"); if (atlas->TexData && atlas->TexData->Format != atlas->TexDesiredFormat) - { - ImVec2i new_tex_size = ImFontAtlasTextureGetSizeEstimate(atlas); - ImFontAtlasBuildDestroy(atlas); - ImFontAtlasTextureAdd(atlas, new_tex_size.x, new_tex_size.y); - } + ImFontAtlasBuildClear(atlas); if (atlas->Builder == NULL) ImFontAtlasBuildInit(atlas);