mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-05 19:08:19 +00:00
Fonts: fixed an issue calling legacy ImFontAtlas::Clear().
This commit is contained in:
@@ -2637,8 +2637,6 @@ void ImFontAtlas::Clear()
|
||||
RendererHasTextures = false; // Full Clear() is supported, but ClearTexData() only isn't.
|
||||
ClearFonts();
|
||||
ClearTexData();
|
||||
if (Builder != NULL)
|
||||
ImFontAtlasBuildClearTexture(this);
|
||||
RendererHasTextures = backup_renderer_has_textures;
|
||||
}
|
||||
|
||||
@@ -3374,8 +3372,6 @@ void ImFontAtlasBuildSetupFontLoader(ImFontAtlas* atlas, const ImFontLoader* fon
|
||||
|
||||
atlas->FontLoader = font_loader;
|
||||
atlas->FontLoaderName = font_loader ? font_loader->Name : "NULL";
|
||||
if (atlas->FontLoader && atlas->FontLoader->LoaderInit)
|
||||
atlas->FontLoader->LoaderInit(atlas);
|
||||
|
||||
ImFontAtlasBuildAddTexture(atlas, new_tex_size.x, new_tex_size.y);
|
||||
ImFontAtlasBuildInit(atlas);
|
||||
@@ -4140,8 +4136,12 @@ void ImFontAtlasBuildInit(ImFontAtlas* atlas)
|
||||
return; // ImFontAtlasBuildSetupFontLoader() automatically call ImFontAtlasBuildInit()
|
||||
}
|
||||
|
||||
IM_ASSERT(atlas->FontLoaderData == NULL);
|
||||
if (atlas->FontLoader && atlas->FontLoader->LoaderInit)
|
||||
atlas->FontLoader->LoaderInit(atlas);
|
||||
|
||||
// Create initial texture size
|
||||
if (atlas->TexData == NULL)
|
||||
if (atlas->TexData == NULL || atlas->TexData->Pixels == NULL)
|
||||
ImFontAtlasBuildAddTexture(atlas, ImUpperPowerOfTwo(atlas->TexMinWidth), ImUpperPowerOfTwo(atlas->TexMinHeight));
|
||||
|
||||
ImFontAtlasBuilder* builder = atlas->Builder; // Do not move above
|
||||
|
Reference in New Issue
Block a user