Merge pull request #84004 from groud/support_y_sort_with_runtime_data

Fix Y-sort origin not working when set in TileMap runtime updates
This commit is contained in:
Rémi Verschelde 2023-10-26 16:02:32 +02:00
commit 09946f79bd
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -472,7 +472,13 @@ void TileMapLayer::_rendering_quadrants_update_cell(CellData &r_cell_data, SelfL
TileSetAtlasSource *atlas_source = Object::cast_to<TileSetAtlasSource>(source);
if (atlas_source && atlas_source->has_tile(r_cell_data.cell.get_atlas_coords()) && atlas_source->has_alternative_tile(r_cell_data.cell.get_atlas_coords(), r_cell_data.cell.alternative_tile)) {
is_valid = true;
tile_y_sort_origin = atlas_source->get_tile_data(r_cell_data.cell.get_atlas_coords(), r_cell_data.cell.alternative_tile)->get_y_sort_origin();
const TileData *tile_data;
if (r_cell_data.runtime_tile_data_cache) {
tile_data = r_cell_data.runtime_tile_data_cache;
} else {
tile_data = atlas_source->get_tile_data(r_cell_data.cell.get_atlas_coords(), r_cell_data.cell.alternative_tile);
}
tile_y_sort_origin = tile_data->get_y_sort_origin();
}
}