Fix selection of spaced atlas tile when using priority

(cherry picked from commit 2131b3c61c)
This commit is contained in:
Haoyu Qiu 2021-07-26 20:05:59 +08:00 committed by Rémi Verschelde
parent bd63402ed6
commit 385b88fced
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 1 deletions

View File

@ -661,7 +661,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;
for (int x = 0; x < coord.x; x++) {