From a166b7159434feb90f90a1c86e042a8d4b47227c Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 28 Jul 2022 14:38:19 +0200 Subject: [PATCH] Ported: [3.5] Fix TileMap texture offset for navigationmesh and collisionshapes - smix8 https://github.com/godotengine/godot/commit/e9ca65207e3d66b6f2115d5311306d858d5ffc28 --- modules/rtile_map/tile_map.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/rtile_map/tile_map.cpp b/modules/rtile_map/tile_map.cpp index 7e2b1bf38..85a91b81c 100644 --- a/modules/rtile_map/tile_map.cpp +++ b/modules/rtile_map/tile_map.cpp @@ -591,7 +591,7 @@ void RTileMap::update_dirty_quadrants() { if (shape.is_valid()) { if (tile_set->tile_get_tile_mode(c.id) == RTileSet::SINGLE_TILE || (shapes[j].autotile_coord.x == c.autotile_coord_x && shapes[j].autotile_coord.y == c.autotile_coord_y)) { Transform2D xform; - xform.set_origin(offset.floor()); + xform.set_origin(offset.floor() + tile_ofs); Vector2 shape_ofs = shapes[j].shape_transform.get_origin(); @@ -640,7 +640,7 @@ void RTileMap::update_dirty_quadrants() { if (navpoly.is_valid()) { Transform2D xform; - xform.set_origin(offset.floor() + q.pos); + xform.set_origin(offset.floor() + q.pos + tile_ofs); _fix_cell_transform(xform, c, npoly_ofs, s); RID region = Navigation2DServer::get_singleton()->region_create(); @@ -690,7 +690,7 @@ void RTileMap::update_dirty_quadrants() { } } Transform2D navxform; - navxform.set_origin(offset.floor()); + navxform.set_origin(offset.floor() + tile_ofs); _fix_cell_transform(navxform, c, npoly_ofs, s); vs->canvas_item_set_transform(debug_navigation_item, navxform);