Browse Source

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

ocornut 9 năm trước cách đây
mục cha
commit
87d99fce6b
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      imgui_draw.cpp

+ 1 - 1
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)