Skip to content

Commit 4407cdb

Browse files
committed
Fixes scroll example after inverting UI Y axis (#6290)
1 parent 0981789 commit 4407cdb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/ui/ui.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ fn mouse_scroll(
316316
MouseScrollUnit::Line => mouse_wheel_event.y * 20.,
317317
MouseScrollUnit::Pixel => mouse_wheel_event.y,
318318
};
319-
scrolling_list.position -= dy;
320-
scrolling_list.position = scrolling_list.position.clamp(0., max_scroll);
319+
scrolling_list.position += dy;
320+
scrolling_list.position = scrolling_list.position.clamp(-max_scroll, 0.);
321321
style.position.top = Val::Px(scrolling_list.position);
322322
}
323323
}

0 commit comments

Comments
 (0)