fix: hopefully end infinite wrapping loops

This commit is contained in:
Anna 2022-01-15 23:43:55 -05:00
parent 2d7039deae
commit 2d71db2b5d

View File

@ -67,7 +67,12 @@ internal static class ImGuiUtil {
++text; ++text;
} // skip a space at start of line } // skip a space at start of line
endPrevLine = ImGuiNative.ImFont_CalcWordWrapPositionA(ImGui.GetFont().NativePtr, ImGuiHelpers.GlobalScale, text, textEnd, widthLeft); var newEnd = ImGuiNative.ImFont_CalcWordWrapPositionA(ImGui.GetFont().NativePtr, ImGuiHelpers.GlobalScale, text, textEnd, widthLeft);
if (newEnd == endPrevLine) {
break;
}
endPrevLine = newEnd;
if (endPrevLine == null) { if (endPrevLine == null) {
ImGui.TextUnformatted(""); ImGui.TextUnformatted("");
ImGui.TextUnformatted(""); ImGui.TextUnformatted("");