Merge pull request #68213 from AThousandShips/tile_set_alternatives

Fix incorrect drawing of alternative tiles
This commit is contained in:
Rémi Verschelde 2022-11-04 10:05:40 +01:00
commit d235b022e6
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -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);