diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 45549298..27f8b8e5 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -1841,7 +1841,7 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c } } - const float char_width = ((int)c < IndexXAdvance.Size) ? IndexXAdvance[(int)c] * scale : FallbackXAdvance; + const float char_width = ((int)c < IndexXAdvance.Size ? IndexXAdvance[(int)c] : FallbackXAdvance) * scale; if (ImCharIsSpace(c)) { if (inside_word)