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