mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-18 17:11:23 +01:00
Fonts: fixed a crash when trying to use AddFont() with MergeMode=true on a font that has already been rendered. (#9162)
This commit is contained in:
@@ -74,6 +74,8 @@ Breaking Changes:
|
||||
until a shutdown of the owning context or font atlas.
|
||||
- The fact that handling of `FontDataOwnedByAtlas = false` was broken bypassed
|
||||
the issue altogether.
|
||||
- Fixed a crash when trying to use AddFont() with MergeMode=true on a font that
|
||||
has already been rendered. (#9162) [@ocornut, @cyfewlp]
|
||||
- Removed ImFontConfig::PixelSnapV added in 1.92 which turns out is unnecessary
|
||||
(and misdocumented). Post-rescale GlyphOffset is always rounded.
|
||||
- Popups: changed compile-time 'ImGuiPopupFlags popup_flags = 1' default value to be '= 0' for
|
||||
|
||||
@@ -3049,6 +3049,7 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg_in)
|
||||
{
|
||||
IM_ASSERT(Fonts.Size > 0 && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before.
|
||||
font = font_cfg_in->DstFont ? font_cfg_in->DstFont : Fonts.back();
|
||||
ImFontAtlasFontDiscardBakes(this, font, 0); // Need to discard bakes if the font was already used, because baked->FontLoaderDatas[] will change size. (#9162)
|
||||
}
|
||||
|
||||
// Add to list
|
||||
|
||||
Reference in New Issue
Block a user