Skip to content

Commit

Permalink
Merge pull request Rust-SDL2#996 from DuckerMan/master
Browse files Browse the repository at this point in the history
Implement From<i32> trait for WindowPos
  • Loading branch information
Cobrand authored May 22, 2020
2 parents b6625cc + e1f69b5 commit 4a64a3a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sdl2/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ pub enum WindowPos {
Positioned(i32)
}

impl From<i32> for WindowPos {
fn from(pos: i32) -> Self {
WindowPos::Positioned(pos)
}
}

fn to_ll_windowpos (pos: WindowPos) -> c_int {
match pos {
WindowPos::Undefined => sys::SDL_WINDOWPOS_UNDEFINED_MASK as c_int,
Expand Down

0 comments on commit 4a64a3a

Please sign in to comment.