1
0
mirror of https://github.com/ocornut/imgui.git synced 2025-02-02 12:37:20 +01:00

Fonts: Fixed miscalculation of Ellipsis ("...") character width when automatically created from a single comma character.

This commit is contained in:
ocornut 2025-01-08 18:13:53 +01:00
parent 1c67a3412e
commit 90094a871a
2 changed files with 4 additions and 2 deletions

View File

@ -63,6 +63,8 @@ Other changes:
windows with the ImGuiWindowFlags_NoNavInputs flag. (#8231)
- Debug Tools: Debug Log: hovering 0xXXXXXXXX values in log is allowed even
if a popup is blocking mouse access to the debug log window. (#5855)
- Fonts: Fixed miscalculation of Ellipsis ("...") character width when automatically
created from a single comma character, affecting some fonts/settings (not all).
- Demo: Added label edition to Property Editor demo + fix an ID issue. (#8266) [@moritz-h]
- Misc: Fixed misc/cpp/imgui_stdlib.h/.cpp not supporting IMGUI_DISABLE. (#8294) [@juur]
- Backends: Allegro5: Avoid calling al_set_mouse_cursor() repeatedly since it appears

View File

@ -3799,8 +3799,8 @@ void ImFont::BuildLookupTable()
const ImFontGlyph* glyph = FindGlyph(dot_char);
EllipsisChar = dot_char;
EllipsisCharCount = 3;
EllipsisCharStep = (glyph->X1 - glyph->X0) + 1.0f;
EllipsisWidth = EllipsisCharStep * 3.0f - 1.0f;
EllipsisCharStep = (float)(int)(glyph->X1 - glyph->X0) + 1.0f;
EllipsisWidth = glyph->X0 + EllipsisCharStep * 3.0f - 1.0f;
}
}