From a38bf092a88a2d59a11d7bc428c7c242840d7d6d Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Thu, 20 Apr 2023 13:34:38 -0700 Subject: Export scroll_to helper --- native/src/widget/scrollable.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'native/src') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index c9ad5947..e35a4f96 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -392,6 +392,15 @@ pub fn snap_to( Command::widget(operation::scrollable::snap_to(id.0, offset)) } +/// Produces a [`Command`] that scrolls the [`Scrollable`] with the given [`Id`] +/// to the provided [`AbsoluteOffset`] along the x & y axis. +pub fn scroll_to( + id: Id, + offset: AbsoluteOffset, +) -> Command { + Command::widget(operation::scrollable::scroll_to(id.0, offset)) +} + /// Computes the layout of a [`Scrollable`]. pub fn layout( renderer: &Renderer, -- cgit