summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNinni Pipping <ninni.pipping@gmail.com>2022-11-03 16:17:36 +0100
committerNinni Pipping <ninni.pipping@gmail.com>2022-11-03 16:17:36 +0100
commit4b29f71685e66e49fc5f6fca0fc8d3fcc0e97121 (patch)
tree2aa5eefd29b8881c1a22ca475a5be0e805f227bf
parent879aac9db44c90000197ef02ae048c71f7500a2b (diff)
Fix incorrect drawing of alternative tiles
-rw-r--r--editor/plugins/tiles/tile_set_atlas_source_editor.cpp4
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);