Fonts: AddFontDefaultBitmap() doesn't need to explicitely set OversampleH/OversampleV to 1 as this is automatic.

This commit is contained in:
ocornut
2026-02-12 19:35:41 +01:00
parent 9c33672e5c
commit a8bf659143
2 changed files with 2 additions and 5 deletions

View File

@@ -3143,10 +3143,7 @@ ImFont* ImFontAtlas::AddFontDefaultBitmap(const ImFontConfig* font_cfg_template)
#ifndef IMGUI_DISABLE_DEFAULT_FONT
ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
if (!font_cfg_template)
{
font_cfg.OversampleH = font_cfg.OversampleV = 1;
font_cfg.PixelSnapH = true;
}
font_cfg.PixelSnapH = true; // Will also automatically set OversampleH = OversampleV = 1
if (font_cfg.SizePixels <= 0.0f)
font_cfg.SizePixels = 13.0f; // This only serves (1) as a reference for GlyphOffset.y setting and (2) as a default for pre-1.92 backend.
if (font_cfg.Name[0] == '\0')