-
Notifications
You must be signed in to change notification settings - Fork 882
Fix ListView scrolling with non-uniformly sized items #11657
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
base: master
Are you sure you want to change the base?
Changes from all commits
ce5b989
76bb4d6
8abfcad
f28b0bf
0ea5c76
313ca11
6564205
3e8df36
bd4f987
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -349,15 +349,17 @@ fn update_visible_instances( | |
| viewport_height.set(LogicalLength::new(state.cached_item_height * row_count as Coord)); | ||
| viewport_width.set(LogicalLength::new(vp_width)); | ||
| // If an animation is ongoing we should not interrupt it | ||
| if !viewport_y.has_binding() { | ||
| let new_viewport_y = -state.anchor_y + new_offset_y; | ||
| if new_viewport_y != viewport_y.get().get() { | ||
| viewport_y.set(LogicalLength::new(new_viewport_y)); | ||
| } | ||
| state.previous_viewport_y = new_viewport_y; | ||
| } else { | ||
| state.previous_viewport_y = viewport_y.get().0; | ||
| let new_viewport_y = -state.anchor_y + new_offset_y; | ||
| // Important: Use get_internal here, the viewport_y may have a binding on it (especially | ||
| // a physical animation). | ||
| // We must not yet trigger a re-evaluation of that binding, as we have already updated the | ||
| // viewport_width and viewport_height, but the viewport_y is not yet consistent. | ||
| // So the physics animations limit value may be inconsistent. | ||
| if new_viewport_y != viewport_y.get_internal().get() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change looks good. In case there is an animation, and the item had different size, the animation will stop, but that's better than having the flickable misbehave. |
||
| viewport_y.set(LogicalLength::new(new_viewport_y)); | ||
| } | ||
| state.previous_viewport_y = new_viewport_y; | ||
|
|
||
| break; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is no longer attached to the right code, or is stale.