mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Potential infinite loop while wrapping text
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user