mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
Fix off-by-one error in StateInner::visible_range
I even wonder if we should keep this function around, as it feels like it can only be called at certain times (e.g. layout) and not after a splice or a scroll where we may not have rendered the elements we actually need.
This commit is contained in:
parent
0a22dee764
commit
c7a8972a57
1 changed files with 2 additions and 2 deletions
|
@ -390,8 +390,8 @@ impl StateInner {
|
|||
cursor.seek(&Count(scroll_top.item_ix), Bias::Right, &());
|
||||
let start_y = cursor.sum_start().0 + scroll_top.offset_in_item;
|
||||
let mut cursor = cursor.swap_dimensions();
|
||||
cursor.seek_forward(&Height(start_y + height), Bias::Right, &());
|
||||
scroll_top.item_ix..cursor.sum_start().0
|
||||
cursor.seek_forward(&Height(start_y + height), Bias::Left, &());
|
||||
scroll_top.item_ix..cursor.sum_start().0 + 1
|
||||
}
|
||||
|
||||
fn visible_elements<'a>(
|
||||
|
|
Loading…
Reference in a new issue