mirror of https://github.com/WerWolv/ImHex
fix: Potential infinite loop while wrapping text
This commit is contained in:
parent
46fdbd5bc0
commit
0e5136196a
|
|
@ -1063,6 +1063,9 @@ namespace ImGuiExt {
|
|||
auto textEnd = text + strlen(text);
|
||||
for (auto wrapPos = text; wrapPos != textEnd;) {
|
||||
wrapPos = ImGui::GetFont()->CalcWordWrapPosition(GetFontSize(), wrapPos, textEnd, availableSpace.x * 0.8F);
|
||||
if (text == wrapPos)
|
||||
break;
|
||||
|
||||
drawString += std::string(text, wrapPos) + "\n";
|
||||
text = wrapPos;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue