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

imgui_freetype: fixed overwriting ImFontConfig::PixelSnapH when hinting is enabled.

Fix/amend 99f6b305c1.
This commit is contained in:
ocornut 2025-12-22 17:51:24 +01:00
parent d87650dffb
commit 9055c9ed22
3 changed files with 8 additions and 7 deletions

View file

@ -3392,6 +3392,7 @@ void ImFontAtlasBuildMain(ImFontAtlas* atlas)
void ImFontAtlasBuildGetOversampleFactors(ImFontConfig* src, ImFontBaked* baked, int* out_oversample_h, int* out_oversample_v)
{
// (Only used by stb_truetype builder)
// Automatically disable horizontal oversampling over size 36
const float raster_size = baked->Size * baked->RasterizerDensity * src->RasterizerDensity;
*out_oversample_h = (src->OversampleH != 0) ? src->OversampleH : (raster_size > 36.0f || src->PixelSnapH) ? 1 : 2;