summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2016-01-02 18:17:20 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2016-01-02 18:17:20 +0100
commite22e0cecf7bdf7f16956e4657df4b6de77bdee24 (patch)
treed05827b14408669bf302bea7b665c858cab00b13 /scene/2d
parentdf5fa62ab955437f05bfd7acdf6ed61d6d9c827e (diff)
TileMap: Consider texture offset for rotated tiles
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/tile_map.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 7ae87b881c..70937c68da 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -379,10 +379,17 @@ void TileMap::_update_dirty_quadrants() {
/* rect.size.x+=fp_adjust;
rect.size.y+=fp_adjust;*/
- if (c.flip_h)
+ if (c.transpose)
+ SWAP(tile_ofs.x, tile_ofs.y);
+
+ if (c.flip_h) {
rect.size.x=-rect.size.x;
- if (c.flip_v)
+ tile_ofs.x=-tile_ofs.x;
+ }
+ if (c.flip_v) {
rect.size.y=-rect.size.y;
+ tile_ofs.y=-tile_ofs.y;
+ }
Vector2 center_ofs;