summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-21 07:09:50 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-21 07:09:50 +0100
commit26ed518fbead46440a3f52dbf017505c6cf4b597 (patch)
tree2f7d45fc1a47e2d75efdcbb91fb49189d66d2853 /native
parentc04dff99da3c524de6885d3f1ce13b5e24cf5e57 (diff)
downloadiced-26ed518fbead46440a3f52dbf017505c6cf4b597.tar.gz
iced-26ed518fbead46440a3f52dbf017505c6cf4b597.tar.bz2
iced-26ed518fbead46440a3f52dbf017505c6cf4b597.zip
Fix scroll percentage calculation in `Scrollable`
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/scrollable.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index 872c59cb..9fa602d5 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -415,7 +415,8 @@ impl Scrollbar {
grabbed_at: f32,
cursor_position: Point,
) -> f32 {
- (cursor_position.y + self.bounds.y
+ (cursor_position.y
+ - self.bounds.y
- self.scroller.bounds.height * grabbed_at)
/ (self.bounds.height - self.scroller.bounds.height)
}