Skip to content

Commit ee03e5d

Browse files
lmaxyzhecrj
authored andcommitted
Fix scrollable touch scrolling when out of bounds
1 parent 0563ee8 commit ee03e5d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

widget/src/scrollable.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -876,18 +876,16 @@ where
876876
}
877877
Event::Touch(event)
878878
if state.scroll_area_touched_at.is_some()
879-
|| !mouse_over_y_scrollbar
880-
&& !mouse_over_x_scrollbar =>
879+
|| (!mouse_over_y_scrollbar
880+
&& !mouse_over_x_scrollbar) =>
881881
{
882882
match event {
883883
touch::Event::FingerPressed { .. } => {
884-
let Some(cursor_position) = cursor.position()
885-
else {
884+
if cursor_over_scrollable.is_none() {
886885
return;
887-
};
886+
}
888887

889-
state.scroll_area_touched_at =
890-
Some(cursor_position);
888+
state.scroll_area_touched_at = cursor.position();
891889
}
892890
touch::Event::FingerMoved { .. } => {
893891
if let Some(scroll_box_touched_at) =

0 commit comments

Comments
 (0)