Skip to content

Commit ad70083

Browse files
committed
Add scroll_right and scroll_left functions
1 parent 993b7e1 commit ad70083

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/structs/input.rs

+10
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@ impl ButtonState {
164164
self.state > 0
165165
}
166166

167+
/// Returns whether there is a horizontal scroll to the right.
168+
pub fn scroll_right(&self) -> bool {
169+
self.state > 0
170+
}
171+
172+
/// Returns whether there is a horizontal scroll to the left.
173+
pub fn scroll_left(&self) -> bool {
174+
self.state < 0
175+
}
176+
167177
/// Returns the raw state.
168178
pub fn state(&self) -> i32 {
169179
self.state

0 commit comments

Comments
 (0)