From 7e8f0bab222e107046601cf2b2876aa7942ce803 Mon Sep 17 00:00:00 2001 From: MatusGuy <85036874+MatusGuy@users.noreply.github.com> Date: Sat, 22 Jul 2023 20:58:06 +0100 Subject: [PATCH] Allow placing tiles in edges with rect fill tool (#2555) Placing tiles in edges with rect fill tool just won't work for some reason. This fixes that. --- src/editor/overlay_widget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/editor/overlay_widget.cpp b/src/editor/overlay_widget.cpp index 310b107ba16..636eff6cbf3 100644 --- a/src/editor/overlay_widget.cpp +++ b/src/editor/overlay_widget.cpp @@ -1616,9 +1616,9 @@ EditorOverlayWidget::align_to_tilemap(const Vector& sp, int tile_size) const bool EditorOverlayWidget::is_position_inside_tilemap(const TileMap* tilemap, const Vector& pos) const { - return pos.x > 0 && pos.y > 0 && - pos.x <= static_cast(tilemap->get_width()) && - pos.y <= static_cast(tilemap->get_height()); + return pos.x >= 0 && pos.y >= 0 && + pos.x < static_cast(tilemap->get_width()) && + pos.y < static_cast(tilemap->get_height()); } /* EOF */