You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ImGui::TextWrapped and other text functions using wrap-pos settings will cause too-many-vertices error when displaying long single-line strings.
Background: I met this problem when trying to TextWrapped the lines getline-ed from files. I got the assertion failure after unexpectedly opening a large non-text file (which does not contain \n).
Similar issue: #5720
The text was updated successfully, but these errors were encountered:
achabense
changed the title
TextWrapped will cause too-many-vertices error for long single linesTextWrapped will cause too-many-vertices error for long single lines
Apr 15, 2024
achabense
changed the title
TextWrapped will cause too-many-vertices error for long single linesTextWrapped will cause too-many-vertices error for long single-line strings
Apr 15, 2024
This is a known issue, I don't envision a fuller fix before we replace the text functions (the new WIP text functions don't have this issue). With the mitigation however you are much less likely to encounter the issue, so it may be good enough.
Closing this as I don't expect to fix the current codebase further, but with the mitigation it's more or less not any worse that any other functions.
the new WIP text functions don't have this issue
Actually I was wrong, they also DID have this issue, but I have managed to fix it in the new text functions (no ETA, sorry) for a negligible cost (one pointer compare per visible wrapped line):
Version/Branch of Dear ImGui:
Version 1.90.5
Back-ends:
imgui_impl_sdl2.cpp + imgui_impl_sdlrenderer2.cpp
Compiler, OS:
Windows 10 + MSVC 2022
Full config/build information:
No response
Details:
ImGui::TextWrapped
and other text functions using wrap-pos settings will causetoo-many-vertices
error when displaying longsingle-line
strings.Background: I met this problem when trying to
TextWrapped
the linesgetline
-ed from files. I got the assertion failure after unexpectedly opening a large non-text file (which does not contain\n
).Similar issue: #5720
Screenshots/Video:
The effect for the first example below:
Minimal, Complete and Verifiable Example code:
The problem is not limited to
TextWrapped
. It can affect every text function via wrap-pos settings:The text was updated successfully, but these errors were encountered: