Skip to content

Commit

Permalink
fixed tile map bounding rect calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed Jul 25, 2024
1 parent fb4f80e commit c4e337b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fyrox-impl/src/scene/tilemap/brush.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ impl TileMapBrush {

for tile in self.tiles.iter() {
min = tile.local_position.inf(&min);
max = tile.local_position.sup(&max);

let right_bottom_corner = tile.local_position + Vector2::repeat(1);
max = right_bottom_corner.sup(&max);
}

Rect::from_points(min, max)
Expand Down
4 changes: 3 additions & 1 deletion fyrox-impl/src/scene/tilemap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ impl TileMap {

for tile in self.tiles.values() {
min = tile.position.inf(&min);
max = tile.position.sup(&max);

let right_bottom_corner = tile.position + Vector2::repeat(1);
max = right_bottom_corner.sup(&max);
}

Rect::from_points(min, max)
Expand Down

0 comments on commit c4e337b

Please sign in to comment.