ImFont: CalcWordWrapPositionA() fixed font scaling with fallback character. (followup to 86666489df)

This commit is contained in:
ocornut 2016-09-19 09:32:21 +02:00
parent 0420ab027e
commit 87d99fce6b

View File

@ -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 (ImCharIsSpace(c))
{ {
if (inside_word) if (inside_word)