-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Very large scrollable areas (~millions of lines) cannot be scrolled #679
Comments
Hello, By the way you can use normal ImGui widgets and still seek and display only the visible area, which is what https://github.com/ocornut/imgui/wiki/memory_editor_example is doing. |
It does have a text box to set the current address, which actually just adjusts the scrollbar (which is difficult when there isn't one ;)) Will look at the example, and find some workaround. |
Once scrolling is applied the cursor position are always stored in screen-space, so the "visible area" will always be small numbers and seeking/displaying there will be safe. The easier way if you really want a scrollbar and scrolling that spans that amount of data is to just emulate scrolling yourself (by setting the cursor position) and create a custom scrollbar, which would made sense if you are going to want it to be useful. A traditional scrollbar will just suck at being useful for 200 millions lines? |
I guess this is similar to this one #150 ? I started to make an example of it here but it really doesn't work that good (yet) |
Hey @ocornut, |
@brett19 I don't understand this paragraph. What are you expecting to happen? My point is that a scrollbar just wouldn't be any useful if you are spanning 200 millions lines, so fixing the issue wouldn't help here. How are you expecting to use a scrollbar in a meaningful manner with that amount of data? |
Hey @ocornut, |
Closing this at it looks like original posters don't need it. And added that as a separate task in my list. |
@ocornut Worth to mention is that my code isn't really working that good so it would need to be improved before going into imgui_demo |
Broken link. I suppose https://github.com/ocornut/imgui_club is the current link. It's the first one listed under https://github.com/ocornut/imgui/wiki/Useful-Widgets#miscellaneous. Edit: https://github.com/ocornut/imgui_club/tree/master/imgui_memory_editor seems more accurate. |
When making a very large child area in a window, there is no vertical scrollbar. If you force the vertical scrollbar to appear, then it does appear, but isn't scrollable, as if the area was smaller than what is visible.
Currently, I have a memory viewer/editor, and it renders only the visible text, based on the vertical scrollbar position. The size of the scrollable area is set first via SetCursorPosY(). Rendering is via adding to the ImDrawList of the area.
It works fine, except when I need to view a 32-bit memory space. Just to get an idea of the size, using the default font, 16 bytes displayed per line by default, about 268,435,456 lines * 13 pixels per line.
From a quick look into imgui.cpp, I see that when the cursor position is set, it is cast to (float)(int), and that seem to truncate the result, effectively making the size negative. As a test, I removed the (int) cast at line 3937 of imgui.cpp, so that it's just cast to (float), and that makes the scrollbar work, although it will glitch when scrolling down a certain amount (probably from other (float)(int) casts?)
The text was updated successfully, but these errors were encountered: