Fix tilemap tiles on horizontal/vertical flips

(cherry picked from commit 3f5413693c)
This commit is contained in:
Haz 2020-09-05 17:45:34 -04:00 committed by Rémi Verschelde
parent 49b3750b36
commit 935edf9323
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 3 deletions

View File

@ -814,7 +814,6 @@ void TileMapEditor::_draw_cell(Control *p_viewport, int p_cell, const Point2i &p
r.size = node->get_tileset()->autotile_get_size(p_cell); r.size = node->get_tileset()->autotile_get_size(p_cell);
r.position += (r.size + Vector2(spacing, spacing)) * offset; r.position += (r.size + Vector2(spacing, spacing)) * offset;
} }
Size2 sc = p_xform.get_scale();
Size2 cell_size = node->get_cell_size(); Size2 cell_size = node->get_cell_size();
bool centered_texture = node->is_centered_textures_enabled(); bool centered_texture = node->is_centered_textures_enabled();
bool compatibility_mode_enabled = node->is_compatibility_mode_enabled(); bool compatibility_mode_enabled = node->is_compatibility_mode_enabled();
@ -848,12 +847,12 @@ void TileMapEditor::_draw_cell(Control *p_viewport, int p_cell, const Point2i &p
} }
if (p_flip_h) { if (p_flip_h) {
sc.x *= -1.0; rect.size.x *= -1.0;
tile_ofs.x *= -1.0; tile_ofs.x *= -1.0;
} }
if (p_flip_v) { if (p_flip_v) {
sc.y *= -1.0; rect.size.y *= -1.0;
tile_ofs.y *= -1.0; tile_ofs.y *= -1.0;
} }