Strange scrolling behavior #1784
John-Nagle
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm getting some strange scrolling behavior. Code is in Github here. You can build it and run it. This is a mockup of a user interface I'm using to make sure that Egui, Rend3, Winit, and WGPU all play well together cross-platform before I hook in the heavy machinery of the metaverse client.
So the first screen is a big scroll area of big buttons, one for each metaverse grid.
The code for this follows the instructions here.
It looks fine, but not all the menu items fit, so scrolling is needed. The trouble is, if I scroll down far enough to fully expose the bottom menu item, the display starts flickering, alternating between two scroll states.
So I put a println! in the draw function to see what the row range was doing.
println!("Rows: {:?} of {}, row height {}", row_range, self.grids.len(), row_height); // ***TEMP***
Output is:
Uh oh. So successive calls alternate between starting with row 0 and row 2, and the display looks like what you'd expect with that happening. I'm not doing anything different between calls; it's just a refresh loop.
Also, I noticed that if I have a large number of rows, the row range start may change, but the row range end is always the last item, so it's drawing too much.
Am I doing something wrong, or what?
(Egui 0.17.0, for compatibility with Rend3)
Beta Was this translation helpful? Give feedback.
All reactions