Skip to content

Commit 08fa252

Browse files
committed
correctly select the next larger bitmap size
1 parent d5d2383 commit 08fa252

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

misc/freetype/imgui_freetype.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ static bool ImGui_ImplFreeType_FontBakedInit(ImFontAtlas* atlas, ImFontConfig* s
451451
if (ImFabs(cur_height - size) < 0.001f)
452452
{
453453
best_index = i;
454+
best_height = cur_height;
454455
break;
455456
}
456457
else if (cur_height < size)
@@ -463,7 +464,7 @@ static bool ImGui_ImplFreeType_FontBakedInit(ImFontAtlas* atlas, ImFontConfig* s
463464
}
464465
else
465466
{
466-
if (best_height > cur_height)
467+
if (best_height < size && best_height < cur_height)
467468
{
468469
best_index = i;
469470
best_height = cur_height;

0 commit comments

Comments
 (0)