mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
CalcListClipping, should it start with the first partially visible row? Or scroll in increments of row height? #716
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#716
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While working with a large table I noticed that while scrolling the start of the first visible row looked like it was padding + height of clipped text that wouldn't be fully visible.
Is there a way to make the scrollbar scroll in increments of row height?
The padding becomes consistent if I change line 2990 to:
start = ImClamp(start - 1, 0, items_count);
From:
start = ImClamp(start, 0, items_count);
But then the first row is not always fully visible.
Thanks!
Andrew
Could you provide demo/repro code please?
Added a demo in a repo here:
https://github.com/MauganRa/ImGuiTableTest
Right now it's set to render the partial line.
Thanks, I will look at it later this week. Generally it is ten times easier (and faster to fix) if:
Okay, I'll create a gist/snippet to reproduce what I'm seeing.
Here is a screenshot:

Thanks!
Code to reproduce the issue:
Screenshot:

Hi,
Thanks! Below the same test code with less unnecessary information. Please take the time to trim your code when submitting future issues because it usually both helps you and me in understanding a problem. In many instances people find a solution just by clarifying their repro. Otherwise it helps me seeing through it and eventually all of those bugs will make it into a test suite, so the simpler the better.
You could either a) maintain an ordered list of open tree-node to do an optimal fast-forward/seek the same way
ImGuiListClipperdoes. Aka given your list of opened tree-node figure out where to seek in view. This is a little more complex that usingImGuiListClipperas is but pretty much requirement if you want to deal with enormous list with items of varying sizes.Or you could b) not have a tree node here.. Instead use a popup window, context menu, tooltip etc. anything overlayed that wouldn't alter the list layout. It seems like a more sensible solution in this sort of design because you are unlikely to want to see the details of multiple items. Anytime I wanted to do (a) it was cumbersome and (b) ended up making more some.
I was about to say that your line
if (clipper.StepNo > 0) // we only want to render after step 0is absolutely incorrect and illegal and would break the clipper in some circumstances. Upon digging I am finding there is a problem with the clipper introduced in #661 and which is noticeable when using column which explains what you tried to add that code. Looking into it now.The issues should be fixed now.
There's still a minor problem in the sense that ImGuiListClipper needs to adjust for columns - and it works now - but equivalent user-code wouldn't naturally know to do that. So it is less obvious how to make your own clipper from scratch if you had to do so. I'm taking note of it for further columns work #125 and may need to clarify some internal details about seeking.
Wow, thanks! I hadn't noticed the issue with the open nodes when scrolling yet.
I've gotten better support on here than with almost any paid tools I've used, signed up for Patron!