diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-06-08 18:15:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 18:15:51 +0200 |
commit | 3aed396a30d4cbcfb4a63c14b8416dad024808b2 (patch) | |
tree | f7fe4162f6614eb2d3aad8fffe14d015f5bd43b4 /scene/2d/tile_map.cpp | |
parent | 69058d33fc3ab22407a0b2b70cf24075c9e38c0e (diff) | |
parent | d73cdeb2487bbd21d2eb062a13d92199c85cda2f (diff) |
Merge pull request #19343 from bojidar-bg/x-fix-tilemap-shape-rotation
Fix bugs related to bad handling of rotated/translated shapes in tilemap
Diffstat (limited to 'scene/2d/tile_map.cpp')
-rw-r--r-- | scene/2d/tile_map.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 050a3f245d..98275510d6 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -466,10 +466,12 @@ void TileMap::_update_dirty_quadrants() { Transform2D xform; xform.set_origin(offset.floor()); - Vector2 shape_ofs = tile_set->tile_get_shape_offset(c.id, i); + Vector2 shape_ofs = shapes[i].shape_transform.get_origin(); _fix_cell_transform(xform, c, shape_ofs + center_ofs, s); + xform *= shapes[i].shape_transform.untranslated(); + if (debug_canvas_item.is_valid()) { vs->canvas_item_add_set_transform(debug_canvas_item, xform); shape->draw(debug_canvas_item, debug_collision_color); |