Skip to content

Commit

Permalink
Fixes scroll example after inverting UI Y axis (bevyengine#6290)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahulst authored and Pietrek14 committed Dec 17, 2022
1 parent 0942ad4 commit a297a5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/ui/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ fn mouse_scroll(
MouseScrollUnit::Line => mouse_wheel_event.y * 20.,
MouseScrollUnit::Pixel => mouse_wheel_event.y,
};
scrolling_list.position -= dy;
scrolling_list.position = scrolling_list.position.clamp(0., max_scroll);
scrolling_list.position += dy;
scrolling_list.position = scrolling_list.position.clamp(-max_scroll, 0.);
style.position.top = Val::Px(scrolling_list.position);
}
}
Expand Down

0 comments on commit a297a5c

Please sign in to comment.