Fix scrolling sticking to top (#13874)
The problem seemingly was that scrolling only started after autoscroll has finished. I have added a function to forcefully stop it, which I call when scroll event happens Release Notes: - Fixed delay when changing scrolling direction (#13720) --------- Co-authored-by: Piotr <piotr@zed.dev>
This commit is contained in:
parent
275dd3fa81
commit
2a97aad273
1 changed files with 5 additions and 0 deletions
|
@ -3660,6 +3660,11 @@ impl EditorElement {
|
||||||
if scroll_position != current_scroll_position {
|
if scroll_position != current_scroll_position {
|
||||||
editor.scroll(scroll_position, axis, cx);
|
editor.scroll(scroll_position, axis, cx);
|
||||||
cx.stop_propagation();
|
cx.stop_propagation();
|
||||||
|
} else if y < 0. {
|
||||||
|
// Due to clamping, we may fail to detect cases of overscroll to the top;
|
||||||
|
// We want the scroll manager to get an update in such cases and detect the change of direction
|
||||||
|
// on the next frame.
|
||||||
|
cx.notify();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue