Fix scroll percentage calculation in Scrollable

This commit is contained in:
Héctor Ramón Jiménez 2019-12-21 07:09:50 +01:00
parent c04dff99da
commit 26ed518fbe

View file

@ -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)
}