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

(Breaking) Fonts: remove ImFontConfig::PixelSnapV. Post-rescale GlyphOffset is always rounded.

Amend 99f6b305c, 99bca397d8.
This commit is contained in:
ocornut 2025-12-23 14:30:16 +01:00
parent 55ad3b4abd
commit 73dd0e869d
5 changed files with 30 additions and 32 deletions

View file

@ -50,17 +50,21 @@ Breaking Changes:
- This will invalidate hashes (stored in .ini data) for Tables and Windows
that are using the "###" operators. (#713, #1698)
- Renamed helper macro IM_ARRAYSIZE() -> IM_COUNTOF(). Kept redirection/legacy name.
- Fonts: Fixed handling of `ImFontConfig::FontDataOwnedByAtlas = false` which
did erroneously make a copy of the font data, essentially defeating the purpose
of this flag and wasting memory (undetected since July 2015 and now spotted
by @TellowKrinkle, this is perhaps the oldest bug in Dear ImGui history,
albeit for a rarely used feature!) (#9086, #8465)
HOWEVER, fixing this bug is likely to surface bugs in user/app code:
- Prior to 1.92, font data only needs to be available during the atlas->AddFontXXX() call.
- Since 1.92, font data needs to available until atlas->RemoveFont(), or more typically
until a shutdown of the owning context or font atlas.
- The fact that handling of `FontDataOwnedByAtlas = false` was broken
bypassed the issue altogether.
- Fonts:
- Fixed handling of `ImFontConfig::FontDataOwnedByAtlas = false` which
did erroneously make a copy of the font data, essentially defeating the purpose
of this flag and wasting memory (undetected since July 2015 and now spotted
by @TellowKrinkle, this is perhaps the oldest bug in Dear ImGui history,
albeit for a rarely used feature!) (#9086, #8465)
HOWEVER, fixing this bug is likely to surface bugs in user/app code:
- Prior to 1.92, font data only needs to be available during the atlas->AddFontXXX() call.
Since 1.92, font data needs to available until atlas->RemoveFont(), or more typically
until a shutdown of the owning context or font atlas.
- The fact that handling of `FontDataOwnedByAtlas = false` was broken bypassed
the issue altogether.
- Removed ImFontConfig::PixelSnapV added in 1.92 which turns out is unnecessary
(and misdocumented). Post-rescale GlyphOffset is always rounded.
Other Changes:
@ -70,7 +74,7 @@ Other Changes:
- imgui_freetype: fixed overwriting ImFontConfig::PixelSnapH when hinting
is enabled, creating side-effects when later disabling hinting or
dynamically switching to stb_truetype rasterizer.
which would prevent
- Post rescale GlyphOffset is always rounded.
- Textures:
- Fixed a building issue when ImTextureID is defined as a struct.
- Fixed displaying texture # in Metrics/Debugger window.