1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Fonts: fixed CalcWordWrapPositionA() fallback when width is too small to wrap with multibyte codepoints.. (#8540)

This commit is contained in:
ocornut 2025-04-01 22:53:00 +02:00
parent 8098d79ca2
commit fcab22f80f
2 changed files with 3 additions and 1 deletions

View file

@ -4027,7 +4027,7 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
// Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
// +1 may not be a character start point in UTF-8 but it's ok because caller loops use (text >= word_wrap_eol).
if (s == text && text < text_end)
return s + 1;
return s + ImTextCountUtf8BytesFromChar(s, text_end);
return s;
}