Skip to content

Commit

Permalink
Merge pull request #50886 from timothyqiu/tileset-atlas
Browse files Browse the repository at this point in the history
[3.x] Fix selection of spaced atlas tile when using priority
  • Loading branch information
akien-mga authored Jul 26, 2021
2 parents cc194f6 + 2131b3c commit c376aa6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scene/resources/tile_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
for (int x = 0; x < coord.x; x++) {
Expand Down

0 comments on commit c376aa6

Please sign in to comment.