-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImDrawList::_OnChangedVtxOffset crash when scrolling a Multi-line Text Input with extremely long lines #3349
Comments
…ne of text with more than ~16 KB characters. (#3349)
Hello, I can confirm this issue happens if you e.g. paste the given text twice. One issue is we reserve vertices ahead for the worse case scenario (all characters visible) and in this case it makes us reserve above 64k at once, which is technically undefined but because most of the text ends up clipped it ends up fitting in much less and it all goes fine. That unrelated assert catches it somehow by luck. It's not actually incorrect to remove that assert., so that's I'm doing that now. That would lift the issue for the majority use cases but isn't technically be 100% fail-proof.
This issue is only affecting the lower-level There are many possible ways to tackle it, but I'm tempted to wait until upcoming text function refactor because support for alignment will lead us to know the length of each line, and therefore allow us to provide optimized clipping for horizontal lines. |
To clarify: removing the asserts will effectively fix your issue. |
Thanks for the quick update/fix! |
…ne of text with more than ~16 KB characters. (ocornut#3349)
Version/Branch of Dear ImGui:
Back-end/Renderer/Compiler/OS
Back-ends: "imgui_impl_sdl.h" "imgui_impl_opengl3.h"
Operating System: ArchLinux Linux 5.7.7-arch1-1 #1 SMP PREEMPT Wed, 01 Jul 2020 14:53:16 +0000 x86_64 GNU/Linux
My Issue/Question:
When using a Multi-line Text Input (in my case also with resize callback), if I paste text from clipboard or load a file with very long lines, scrolling will cause the following:
Example text file: https://pastebin.com/raw/mPvzhXJ9
This is reproducible in the
example_sdl_opengl3
demo.Screenshots/Video
Standalone, minimal, complete and verifiable example: (see #2261)
The text was updated successfully, but these errors were encountered: