1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Make stick_to_bottom take a bool argument

This commit is contained in:
Emil Ernerfeldt
2022-08-02 20:34:50 +02:00
parent 263c9bd601
commit 06adb09fa3
4 changed files with 11 additions and 13 deletions

View File

@@ -272,8 +272,8 @@ impl ScrollArea {
/// it will remain focused on whatever content viewport the user left it on. If the scroll
/// handle is dragged all the way to the right it will again become stuck and remain there
/// until manually pulled from the end position.
pub fn stick_to_right(mut self) -> Self {
self.stick_to_end[0] = true;
pub fn stick_to_right(mut self, stick: bool) -> Self {
self.stick_to_end[0] = stick;
self
}
@@ -283,8 +283,8 @@ impl ScrollArea {
/// it will remain focused on whatever content viewport the user left it on. If the scroll
/// handle is dragged to the bottom it will again become stuck and remain there until manually
/// pulled from the end position.
pub fn stick_to_bottom(mut self) -> Self {
self.stick_to_end[1] = true;
pub fn stick_to_bottom(mut self, stick: bool) -> Self {
self.stick_to_end[1] = stick;
self
}
}