Fix first/last item margin on scroll (#8880)
 Before: https://github.com/zed-industries/zed/assets/5518/f7a4563a-504a-4a41-bfd4-21e9439cd02b After: https://github.com/zed-industries/zed/assets/5518/0ba41527-46fd-404f-8207-1b8c5cf37434 Release Notes: - Fixed first and last item margin when scroll view has padding
This commit is contained in:
parent
537d92533c
commit
0b34b1de7b
4 changed files with 7 additions and 5 deletions
|
@ -241,7 +241,7 @@ impl ListState {
|
|||
let mut cursor = state.items.cursor::<ListItemSummary>();
|
||||
cursor.seek(&Count(ix + 1), Bias::Right, &());
|
||||
let bottom = cursor.start().height + padding.top;
|
||||
let goal_top = px(0.).max(bottom - height);
|
||||
let goal_top = px(0.).max(bottom - height + padding.bottom);
|
||||
|
||||
cursor.seek(&Height(goal_top), Bias::Left, &());
|
||||
let start_ix = cursor.start().count;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue