Merge pull request #50886 from timothyqiu/tileset-atlas

[3.x] Fix selection of spaced atlas tile when using priority
This commit is contained in:
Rémi Verschelde 2021-07-26 15:39:00 +02:00 committed by GitHub
commit c376aa669e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -662,7 +662,8 @@ Vector2 TileSet::atlastile_get_subtile_by_priority(int p_id, const Node *p_tilem
} }
} }
Vector2 coord = tile_get_region(p_id).size / autotile_get_size(p_id); const Vector2 spacing(autotile_get_spacing(p_id), autotile_get_spacing(p_id));
const Vector2 coord = tile_get_region(p_id).size / (autotile_get_size(p_id) + spacing);
List<Vector2> coords; List<Vector2> coords;
for (int x = 0; x < coord.x; x++) { for (int x = 0; x < coord.x; x++) {