Skip to content

Commit

Permalink
Merge Rust-SDL2#711: Change HatState::Leftdown into HatState::LeftDown
Browse files Browse the repository at this point in the history
* Fix HatState::Leftdown casing into HatState::LeftDown
* Fixed example
* Added an entry to the changelog
  • Loading branch information
Cobrand authored Oct 27, 2017
2 parents 72aeb73 + 8e88e75 commit 23987db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ when upgrading from a version of rust-sdl2 to another.

### v0.31

[PR #711](https://github.com/Rust-SDL2/rust-sdl2/pull/711)

* **Breaking change** Change HatState::Leftdown casing into HatState::LeftDown to be consistent with naming.

[PR #673](https://github.com/Rust-sdl2/rust-sdl2/pull/673)

* Support Audio Capture in AudioCallbacks.
Expand All @@ -11,7 +15,7 @@ when upgrading from a version of rust-sdl2 to another.

* **Breaking change** Make get\_swap\_interval return an enum instead of i32
* The signature of set\_swap\_interval has been changed as well, but it shouldn't
breaking exisitng code too much.
breaking existing code too much.

[PR #683](https://github.com/Rust-sdl2/rust-sdl2/pull/684)

Expand Down
6 changes: 3 additions & 3 deletions src/sdl2/joystick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ pub enum HatState {
RightUp = 0x02 | 0x01,
RightDown = 0x02 | 0x04,
LeftUp = 0x08 | 0x01,
Leftdown = 0x08 | 0x04,
LeftDown = 0x08 | 0x04,
}

impl HatState {
Expand All @@ -390,7 +390,7 @@ impl HatState {
3 => HatState::RightUp,
6 => HatState::RightDown,
9 => HatState::LeftUp,
12 => HatState::Leftdown,
12 => HatState::LeftDown,
_ => panic!("Unexpected hat position: {}", raw),
}
}
Expand All @@ -405,7 +405,7 @@ impl HatState {
HatState::RightUp => 3,
HatState::RightDown => 6,
HatState::LeftUp => 9,
HatState::Leftdown => 12,
HatState::LeftDown => 12,
}

}
Expand Down

0 comments on commit 23987db

Please sign in to comment.