Skip to content

Commit

Permalink
Add scroll_right and scroll_left functions
Browse files Browse the repository at this point in the history
  • Loading branch information
TimonPost committed Jun 12, 2023
1 parent 993b7e1 commit ad70083
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/structs/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ impl ButtonState {
self.state > 0
}

/// Returns whether there is a horizontal scroll to the right.
pub fn scroll_right(&self) -> bool {
self.state > 0
}

/// Returns whether there is a horizontal scroll to the left.
pub fn scroll_left(&self) -> bool {
self.state < 0
}

/// Returns the raw state.
pub fn state(&self) -> i32 {
self.state
Expand Down

0 comments on commit ad70083

Please sign in to comment.