summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorZae <zaevi@live.com>2022-11-25 00:44:02 +0800
committerZae <zaevi@live.com>2022-11-25 00:44:02 +0800
commitf6424e68ea0c68d7538b9d2b20f0448070956dba (patch)
tree74758783c6f42e5f3b30ab9ad937c931091ca05a /editor/plugins
parentcd3d6e63a630414297cb580bcc891a0aa9f25127 (diff)
[TileMap] Fix alternative tile issues.
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/tiles/tile_data_editors.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp
index 42eceb82ab..b3fef6d4b4 100644
--- a/editor/plugins/tiles/tile_data_editors.cpp
+++ b/editor/plugins/tiles/tile_data_editors.cpp
@@ -153,7 +153,14 @@ void GenericTilePolygonEditor::_base_control_draw() {
// Draw the background.
if (background_texture.is_valid()) {
- base_control->draw_texture_rect_region(background_texture, Rect2(-background_region.size / 2 - background_offset, background_region.size), background_region, background_modulate, background_transpose);
+ Size2 region_size = background_region.size;
+ if (background_h_flip) {
+ region_size.x = -region_size.x;
+ }
+ if (background_v_flip) {
+ region_size.y = -region_size.y;
+ }
+ base_control->draw_texture_rect_region(background_texture, Rect2(-background_region.size / 2 - background_offset, region_size), background_region, background_modulate, background_transpose);
}
// Draw the polygons.