Skip to content

Commit

Permalink
Prevent going past lower and right edges
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusGuy authored Jul 22, 2023
1 parent 0e2c978 commit 44dd8fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/editor/overlay_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1617,8 +1617,8 @@ bool
EditorOverlayWidget::is_position_inside_tilemap(const TileMap* tilemap, const Vector& pos) const
{
return pos.x >= 0 && pos.y >= 0 &&
pos.x <= static_cast<float>(tilemap->get_width()) &&
pos.y <= static_cast<float>(tilemap->get_height());
pos.x < static_cast<float>(tilemap->get_width()) &&
pos.y < static_cast<float>(tilemap->get_height());
}

/* EOF */

0 comments on commit 44dd8fb

Please sign in to comment.