Skip to content

Commit 7b2b67c

Browse files
committed
Round FontSize and FontLineHeight after scaling.
1 parent d843f40 commit 7b2b67c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

imgui.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6951,8 +6951,8 @@ void ImGui::SetCurrentFont(ImFont* font)
69516951
g.Font = font;
69526952
g.FontBaseScale = ImMax(0.01f, g.IO.FontGlobalScale * g.Font->Scale);
69536953
const float font_scale = g.FontBaseScale * (g.CurrentWindow ? g.CurrentWindow->CalcFontScale() : 1.0f);
6954-
g.FontSize = g.Font->FontSize * font_scale;
6955-
g.FontLineHeight = (g.Font->FontSize + g.Font->ExtraLineHeight) * font_scale;
6954+
g.FontSize = IM_ROUND(g.Font->FontSize * font_scale);
6955+
g.FontLineHeight = IM_ROUND((g.Font->FontSize + g.Font->ExtraLineHeight) * font_scale);
69566956
g.FontBaselineOffset = g.Font->BaselineOffset * font_scale;
69576957

69586958
ImFontAtlas* atlas = g.Font->ContainerAtlas;

0 commit comments

Comments
 (0)