Escape ## in name of style in imgui visualization(issue 61)

This commit is contained in:
Filip Sykala - NTB T15p 2022-09-21 14:53:53 +02:00
parent 6e15149e7a
commit 3bd557b177
4 changed files with 24 additions and 3 deletions
src/slic3r/GUI

View file

@ -1365,6 +1365,16 @@ std::string ImGuiWrapper::trunc(const std::string &text,
return std::string(result_text) + tail;
}
void ImGuiWrapper::escape_double_hash(std::string &text)
{
// add space between hashes
const std::string search = "##";
const std::string replace = "# #";
size_t pos = 0;
while ((pos = text.find(search, pos)) != std::string::npos)
text.replace(pos, search.length(), replace);
}
ImVec2 ImGuiWrapper::suggest_location(const ImVec2 &dialog_size,
const Slic3r::Polygon &interest,
const ImVec2 &canvas_size)