mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-09 23:54:20 +00:00
Fonts: fixed passing negative sizes to stb_truetype loader.
This commit is contained in:
parent
1e118ab891
commit
402db2ef32
1 changed files with 2 additions and 2 deletions
|
|
@ -4530,10 +4530,10 @@ static bool ImGui_ImplStbTrueType_FontSrcInit(ImFontAtlas* atlas, ImFontConfig*
|
|||
}
|
||||
src->FontLoaderData = bd_font_data;
|
||||
|
||||
if (src->SizePixels > 0.0f)
|
||||
if (src->SizePixels >= 0.0f)
|
||||
bd_font_data->ScaleFactor = stbtt_ScaleForPixelHeight(&bd_font_data->FontInfo, 1.0f);
|
||||
else
|
||||
bd_font_data->ScaleFactor = -stbtt_ScaleForMappingEmToPixels(&bd_font_data->FontInfo, 1.0f);
|
||||
bd_font_data->ScaleFactor = stbtt_ScaleForMappingEmToPixels(&bd_font_data->FontInfo, 1.0f);
|
||||
if (src != src->DstFont->Sources[0])
|
||||
bd_font_data->ScaleFactor *= src->SizePixels / src->DstFont->Sources[0]->SizePixels; // FIXME-NEWATLAS: Should tidy up that a bit
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue