diff options
Diffstat (limited to 'native/src/widget/scrollable.rs')
-rw-r--r-- | native/src/widget/scrollable.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index 8a82be4f..de4c749c 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -102,8 +102,11 @@ where if let Some(scrollbar_grabbed_at) = self.state.scrollbar_grabbed_at { + let ratio = content_bounds.height / bounds.height; + let delta = scrollbar_grabbed_at.y - cursor_position.y; + self.state.scroll( - scrollbar_grabbed_at.y - cursor_position.y, + delta * ratio, bounds, content_bounds, ); |