Skip to content

Commit

Permalink
Merge pull request #383 from johanhelsing/uvec-from-tilemapsize
Browse files Browse the repository at this point in the history
Add impl From<TilemapSize> for UVec2
  • Loading branch information
StarArawn authored Jan 16, 2023
2 parents c2c3659 + a99b80f commit 3171dcb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ impl From<&TilemapSize> for Vec2 {
}
}

impl From<TilemapSize> for UVec2 {
fn from(size: TilemapSize) -> Self {
UVec2::new(size.x, size.y)
}
}

impl From<UVec2> for TilemapSize {
fn from(vec: UVec2) -> Self {
TilemapSize { x: vec.x, y: vec.y }
Expand Down

0 comments on commit 3171dcb

Please sign in to comment.