mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 23:06:13 +08:00
Fix imgui truncation
This commit is contained in:
parent
4d31128837
commit
5c481a6da5
@ -1162,7 +1162,7 @@ std::string ImGuiWrapper::trunc(const std::string &text,
|
|||||||
++count_letter;
|
++count_letter;
|
||||||
std::string act_text = text.substr(0, count_letter);
|
std::string act_text = text.substr(0, count_letter);
|
||||||
text_width = ImGui::CalcTextSize(act_text.c_str()).x;
|
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);
|
result_text = std::move(act_text);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1171,10 +1171,9 @@ std::string ImGuiWrapper::trunc(const std::string &text,
|
|||||||
--count_letter;
|
--count_letter;
|
||||||
result_text = text.substr(0, count_letter);
|
result_text = text.substr(0, count_letter);
|
||||||
text_width = ImGui::CalcTextSize(result_text.c_str()).x;
|
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);
|
assert(false);
|
||||||
return "Should not be accessible";
|
return "Should not be accessible";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user