From 5c481a6da597656f0289a1b416ec4e307c044d92 Mon Sep 17 00:00:00 2001 From: Filip Sykala Date: Fri, 14 Jan 2022 09:36:42 +0100 Subject: [PATCH] Fix imgui truncation --- src/slic3r/GUI/ImGuiWrapper.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 98aa6c97a..bd3676c08 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -1162,7 +1162,7 @@ std::string ImGuiWrapper::trunc(const std::string &text, ++count_letter; std::string act_text = text.substr(0, count_letter); text_width = ImGui::CalcTextSize(act_text.c_str()).x; - if (text_width < allowed_width) return result_text; + if (text_width < allowed_width) return result_text+tail; result_text = std::move(act_text); } } else { @@ -1171,10 +1171,9 @@ std::string ImGuiWrapper::trunc(const std::string &text, --count_letter; result_text = text.substr(0, count_letter); text_width = ImGui::CalcTextSize(result_text.c_str()).x; - if (text_width > allowed_width) return result_text; + if (text_width > allowed_width) return result_text+tail; } } - assert(false); return "Should not be accessible"; }