Fonts: removed size rounding in AddFont() which breaks relative sizing of merged fonts (8502)

# Conflicts:
#	imgui.cpp
This commit is contained in:
ocornut
2025-03-20 15:45:27 +01:00
parent 2de15dc64b
commit 168b97c291
3 changed files with 13 additions and 7 deletions

View File

@@ -8628,7 +8628,12 @@ void ImGui::UpdateCurrentFontSize()
final_size *= g.Font->Scale;
if (ImGuiWindow* window = g.CurrentWindow)
final_size *= window->FontWindowScale;
final_size = ImMax(1.0f, IM_ROUND(final_size));
// Round font size
// - We started rounding in 1.90 WIP (18991) as our layout system currently doesn't support non-rounded font size well yet.
// - We may support it better later and remove this rounding.
final_size = GetRoundedFontSize(final_size);
final_size = ImMax(1.0f, final_size);
g.FontSize = final_size;
g.FontBaked = (g.Font != NULL) ? g.Font->GetFontBaked(g.FontSize) : NULL;