summaryrefslogtreecommitdiffstats
path: root/native/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-02 01:50:29 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-02 01:50:29 +0100
commit1242b334fe325ee724d9111bc609560e817cea02 (patch)
tree3086c60bd4e3f9c048204153416aadec495cf6a4 /native/src/widget
parent8a0a31c513e02d01e71fdf989709bbfc6bb4579a (diff)
parent85dab04965940f15cf0e9879e296f67235a3775c (diff)
downloadiced-1242b334fe325ee724d9111bc609560e817cea02.tar.gz
iced-1242b334fe325ee724d9111bc609560e817cea02.tar.bz2
iced-1242b334fe325ee724d9111bc609560e817cea02.zip
Merge branch 'feature/scrollables' into feature/text-input
Diffstat (limited to 'native/src/widget')
-rw-r--r--native/src/widget/scrollable.rs5
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,
);