Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/ui/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn on_scroll_handler(
};

if !max {
scroll_position.x += delta.x;
scroll_position.x = (scroll_position.x + delta.x).max(0.0).min(max_offset.x);
// Consume the X portion of the scroll delta.
delta.x = 0.;
}
Expand All @@ -93,7 +93,7 @@ fn on_scroll_handler(
};

if !max {
scroll_position.y += delta.y;
scroll_position.y = (scroll_position.y + delta.y).max(0.0).min(max_offset.y);
// Consume the Y portion of the scroll delta.
delta.y = 0.;
}
Expand Down