mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-28 01:20:55 +01:00
ImFontAtlas: Tweak to allow MergeMode to apply on a font that isn't the previous one, by setting the DstFont field.
This commit is contained in:
parent
1dfafeb602
commit
b4302187dd
@ -1141,6 +1141,7 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
|
|||||||
|
|
||||||
ConfigData.push_back(*font_cfg);
|
ConfigData.push_back(*font_cfg);
|
||||||
ImFontConfig& new_font_cfg = ConfigData.back();
|
ImFontConfig& new_font_cfg = ConfigData.back();
|
||||||
|
if (!new_font_cfg.DstFont)
|
||||||
new_font_cfg.DstFont = Fonts.back();
|
new_font_cfg.DstFont = Fonts.back();
|
||||||
if (!new_font_cfg.FontDataOwnedByAtlas)
|
if (!new_font_cfg.FontDataOwnedByAtlas)
|
||||||
{
|
{
|
||||||
@ -1151,7 +1152,7 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
|
|||||||
|
|
||||||
// Invalidate texture
|
// Invalidate texture
|
||||||
ClearTexData();
|
ClearTexData();
|
||||||
return Fonts.back();
|
return new_font_cfg.DstFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default font TTF is compressed with stb_compress then base85 encoded (see extra_fonts/binary_to_compressed_c.cpp for encoder)
|
// Default font TTF is compressed with stb_compress then base85 encoded (see extra_fonts/binary_to_compressed_c.cpp for encoder)
|
||||||
|
Loading…
Reference in New Issue
Block a user