1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-12 00:14:20 +00:00

correctly select the next larger bitmap size

This commit is contained in:
Green Sky 2025-10-26 11:04:27 +01:00
parent d5d23835e2
commit 08fa252c96
No known key found for this signature in database
GPG key ID: DBE05085D874AB4A

View file

@ -451,6 +451,7 @@ static bool ImGui_ImplFreeType_FontBakedInit(ImFontAtlas* atlas, ImFontConfig* s
if (ImFabs(cur_height - size) < 0.001f)
{
best_index = i;
best_height = cur_height;
break;
}
else if (cur_height < size)
@ -463,7 +464,7 @@ static bool ImGui_ImplFreeType_FontBakedInit(ImFontAtlas* atlas, ImFontConfig* s
}
else
{
if (best_height > cur_height)
if (best_height < size && best_height < cur_height)
{
best_index = i;
best_height = cur_height;