Merge branch 'feature/scrollables' into feature/text-input

This commit is contained in:
Héctor Ramón Jiménez 2019-11-02 01:50:29 +01:00
commit 1242b334fe
3 changed files with 45 additions and 8 deletions

View file

@ -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,
);