Replicate fractional component of leader's scroll position

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-03-22 17:20:13 -07:00
parent 880eaa268b
commit 8699dd9c56
3 changed files with 26 additions and 13 deletions

View file

@ -1039,10 +1039,15 @@ impl Editor {
cx.notify();
}
fn set_scroll_top_anchor(&mut self, anchor: Anchor, local: bool, cx: &mut ViewContext<Self>) {
self.scroll_position = Vector2F::zero();
fn set_scroll_top_anchor(
&mut self,
anchor: Anchor,
position: Vector2F,
cx: &mut ViewContext<Self>,
) {
self.scroll_top_anchor = anchor;
cx.emit(Event::ScrollPositionChanged { local });
self.scroll_position = position;
cx.emit(Event::ScrollPositionChanged { local: false });
cx.notify();
}