Browse Source

RenderTextEllipsis()): pixel align every dot for consistent display.

ocornut 4 months ago
parent
commit
0ddc36f543
1 changed files with 1 additions and 1 deletions
  1. 1 1
      imgui.cpp

+ 1 - 1
imgui.cpp

@@ -3799,7 +3799,7 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con
         RenderTextClippedEx(draw_list, pos_min, pos_max, text, text_end_ellipsis, &text_size, ImVec2(0.0f, 0.0f));
         ImVec4 cpu_fine_clip_rect(pos_min.x, pos_min.y, pos_max.x, pos_max.y);
         ImVec2 ellipsis_pos = ImTrunc(ImVec2(pos_min.x + text_size_clipped_x, pos_min.y));
-        for (int i = 0; i < font->EllipsisCharCount; i++, ellipsis_pos.x += font->EllipsisCharStep * font_scale)
+        for (int i = 0; i < font->EllipsisCharCount; i++, ellipsis_pos.x = IM_TRUNC(ellipsis_pos.x + font->EllipsisCharStep * font_scale))
             font->RenderChar(draw_list, font_size, ellipsis_pos, GetColorU32(ImGuiCol_Text), font->EllipsisChar, &cpu_fine_clip_rect);
     }
     else