summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-03-05 16:57:21 +0100
committerGitHub <noreply@github.com>2019-03-05 16:57:21 +0100
commitae24258842b9d35227a5deb0953bd6ac2c105e64 (patch)
treec84cc170ec7e4c8e9e3da19e31d534d66011c73c /editor
parent6677baedbe195def4af41c9f592b92d8b76ef86a (diff)
parent4cf197fa48c57a5d83f639ffc07d1d0ea306da25 (diff)
Merge pull request #26622 from pyrophone/TilesetPreviewFix
Fixed Tileset preview stretching textures
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index e041c3d62e..4f511dc19f 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -2918,7 +2918,8 @@ void TileSetEditor::update_texture_list_icon() {
for (int current_idx = 0; current_idx < texture_list->get_item_count(); current_idx++) {
RID rid = texture_list->get_item_metadata(current_idx);
texture_list->set_item_icon(current_idx, texture_map[rid]);
- texture_list->set_item_icon_region(current_idx, Rect2(0, 0, 150, 100));
+ Size2 texture_size = texture_map[rid]->get_size();
+ texture_list->set_item_icon_region(current_idx, Rect2(0, 0, MIN(texture_size.x, 150), MIN(texture_size.y, 100)));
}
texture_list->update();
}