diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-07-10 13:41:33 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-10 13:41:33 -0300 |
commit | 46bb02991ff6d7d0ef1ecdda76de015b183d0c08 (patch) | |
tree | 67dedaba598f67bf0d35e4395f7c688f929a0a1c /tools/editor/plugins | |
parent | 223ca1363c32c12a6a5842d1c606280a69f8a5e9 (diff) | |
parent | fff4d5867ce8ae69cd5699a55f7617edb3015f0f (diff) |
Merge pull request #5270 from lonesurvivor/master
Added Tile Origin = Bottom Left option to the TileMap
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r-- | tools/editor/plugins/tile_map_editor_plugin.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 9d27ac8aa3..d686c37d1a 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -412,6 +412,24 @@ void TileMapEditor::_draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h if (node->get_tile_origin()==TileMap::TILE_ORIGIN_TOP_LEFT) { rect.pos+=tile_ofs; + } else if (node->get_tile_origin()==TileMap::TILE_ORIGIN_BOTTOM_LEFT) { + Size2 cell_size = node->get_cell_size(); + + rect.pos+=tile_ofs; + + if(p_transpose) + { + if(p_flip_h) + rect.pos.x-=cell_size.x; + else + rect.pos.x+=cell_size.x; + } else { + if(p_flip_v) + rect.pos.y-=cell_size.y; + else + rect.pos.y+=cell_size.y; + } + } else if (node->get_tile_origin()==TileMap::TILE_ORIGIN_CENTER) { rect.pos+=node->get_cell_size()/2; Vector2 s = r.size; |