diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-04 10:05:40 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-04 10:05:40 +0100 |
commit | d235b022e6057c9f883fd42a0c0ff5c992228312 (patch) | |
tree | 7bf6b19fd3a8d17d1b476bbf8bd9a1489b89ae76 | |
parent | f617c30a1e9a9a1d8e9285ea51af986978f86d57 (diff) | |
parent | 4b29f71685e66e49fc5f6fca0fc8d3fcc0e97121 (diff) |
Merge pull request #68213 from AThousandShips/tile_set_alternatives
Fix incorrect drawing of alternative tiles
-rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 8bf99db43b..ab54a093f2 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -2002,7 +2002,7 @@ void TileSetAtlasSourceEditor::_tile_alternatives_control_unscaled_draw() { continue; } Rect2i rect = tile_atlas_view->get_alternative_tile_rect(coords, alternative_tile); - Vector2 position = rect.get_center(); + Vector2 position = rect.get_center() + tile_set_atlas_source->get_tile_effective_texture_offset(coords, alternative_tile); Transform2D xform = alternative_tiles_control->get_parent_control()->get_transform(); xform.translate_local(position); @@ -2026,7 +2026,7 @@ void TileSetAtlasSourceEditor::_tile_alternatives_control_unscaled_draw() { continue; } Rect2i rect = tile_atlas_view->get_alternative_tile_rect(E.tile, E.alternative); - Vector2 position = rect.get_center(); + Vector2 position = rect.get_center() + tile_set_atlas_source->get_tile_effective_texture_offset(E.tile, E.alternative); Transform2D xform = alternative_tiles_control->get_parent_control()->get_transform(); xform.translate_local(position); |