diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-28 15:40:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 15:40:53 +0100 |
commit | b9de47f4ce13bf795f0768ae7424d7a73d157282 (patch) | |
tree | 7673cb7005d81f2279875066b8e1a146b9d5065a /editor/plugins/tiles/tile_atlas_view.cpp | |
parent | 83c7bf6d941cc67a671ca420c50363540e601b7b (diff) | |
parent | b8b33df1785e5558dd03227c4df3bdeae2012975 (diff) |
Merge pull request #57351 from akien-mga/tileset-get_tile_data-better-return
Diffstat (limited to 'editor/plugins/tiles/tile_atlas_view.cpp')
-rw-r--r-- | editor/plugins/tiles/tile_atlas_view.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index 3b9bde6b0d..35496795e0 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -83,7 +83,7 @@ Size2i TileAtlasView::_compute_alternative_tiles_control_size() { Size2i texture_region_size = tile_set_atlas_source->get_tile_texture_region(tile_id).size; for (int j = 1; j < alternatives_count; j++) { int alternative_id = tile_set_atlas_source->get_alternative_tile_id(tile_id, j); - bool transposed = Object::cast_to<TileData>(tile_set_atlas_source->get_tile_data(tile_id, alternative_id))->get_transpose(); + bool transposed = tile_set_atlas_source->get_tile_data(tile_id, alternative_id)->get_transpose(); line_size.x += transposed ? texture_region_size.y : texture_region_size.x; line_size.y = MAX(line_size.y, transposed ? texture_region_size.x : texture_region_size.y); } @@ -345,7 +345,7 @@ void TileAtlasView::_draw_alternatives() { int alternatives_count = tile_set_atlas_source->get_alternative_tiles_count(atlas_coords); for (int j = 1; j < alternatives_count; j++) { int alternative_id = tile_set_atlas_source->get_alternative_tile_id(atlas_coords, j); - TileData *tile_data = Object::cast_to<TileData>(tile_set_atlas_source->get_tile_data(atlas_coords, alternative_id)); + TileData *tile_data = tile_set_atlas_source->get_tile_data(atlas_coords, alternative_id); bool transposed = tile_data->get_transpose(); // Update the y to max value. @@ -473,7 +473,7 @@ void TileAtlasView::_update_alternative_tiles_rect_cache() { int line_height = 0; for (int j = 1; j < alternatives_count; j++) { int alternative_id = tile_set_atlas_source->get_alternative_tile_id(tile_id, j); - TileData *tile_data = Object::cast_to<TileData>(tile_set_atlas_source->get_tile_data(tile_id, alternative_id)); + TileData *tile_data = tile_set_atlas_source->get_tile_data(tile_id, alternative_id); bool transposed = tile_data->get_transpose(); current.size = transposed ? Vector2i(texture_region_size.y, texture_region_size.x) : texture_region_size; |