1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

(Breaking) Fonts: removed ImFontFlags_DefaultToLegacySize.

This commit is contained in:
ocornut 2025-06-24 19:06:46 +02:00
parent 97e0d59619
commit 89b5a2c3d5
3 changed files with 3 additions and 14 deletions

View file

@ -473,7 +473,7 @@ CODE
- PushFont() API now has a REQUIRED size parameter.
- Before 1.92: PushFont() always used font "default" size specified in AddFont() call. It is equivalent to calling PushFont(font, font->LegacySize).
- Since 1.92: PushFont(font, 0.0f) preserve the current font size which is a shared value.
- To use old behavior: (A) use 'ImGui::PushFont(font, font->LegacySize)' at call site (preferred). (B) Set 'ImFontConfig::Flags |= ImFontFlags_DefaultToLegacySize' in AddFont() call (not desirable as it requires e.g. third-party code to be aware of it).
- To use old behavior: use 'ImGui::PushFont(font, font->LegacySize)' at call site.
- Kept inline single parameter function. Will obsolete.
- Fonts: **IMPORTANT** on Font Merging:
- When searching for a glyph in multiple merged fonts: font inputs are now scanned in orderfor the first font input which the desired glyph. This is technically a different behavior than before!
@ -8911,12 +8911,7 @@ void ImGui::PushFont(ImFont* font, float font_size_base)
g.FontStack.push_back({ g.Font, g.FontSizeBase, g.FontSize });
if (font_size_base == 0.0f)
{
if (font->Flags & ImFontFlags_DefaultToLegacySize)
font_size_base = font->LegacySize; // Legacy: use AddFont() specified font size. Same as doing PushFont(font, font->LegacySize)
else
font_size_base = g.FontSizeBase; // Keep current font size
}
font_size_base = g.FontSizeBase; // Keep current font size
SetCurrentFont(font, font_size_base, 0.0f);
}