summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-13 08:32:48 +0200
committerGitHub <noreply@github.com>2019-08-13 08:32:48 +0200
commit4403744ef97dd3584173ef7bf5108650ed1eff25 (patch)
treee6a4acb681e5ad2ad28fa40c94151df1262f1909
parent57270dd943f858dbbf9f2915f027baa95c1bdc50 (diff)
parent69438149f5b1e62e8cc57ce66553061c1f63a49d (diff)
Merge pull request #31335 from Xenoamor/bugfix/GridMapListTextCutoff
Fix GridMap list text not expanding when palette is resized
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 5a21833ffa..9712f2b5e7 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -863,19 +863,21 @@ void GridMapEditor::_icon_size_changed(float p_value) {
void GridMapEditor::update_palette() {
int selected = mesh_library_palette->get_current();
+ float min_size = EDITOR_DEF("editors/grid_map/preview_size", 64);
+ min_size *= EDSCALE;
+
mesh_library_palette->clear();
if (display_mode == DISPLAY_THUMBNAIL) {
mesh_library_palette->set_max_columns(0);
mesh_library_palette->set_icon_mode(ItemList::ICON_MODE_TOP);
+ mesh_library_palette->set_fixed_column_width(min_size * MAX(size_slider->get_value(), 1.5));
} else if (display_mode == DISPLAY_LIST) {
mesh_library_palette->set_max_columns(1);
mesh_library_palette->set_icon_mode(ItemList::ICON_MODE_LEFT);
+ mesh_library_palette->set_fixed_column_width(0);
}
- float min_size = EDITOR_DEF("editors/grid_map/preview_size", 64);
- min_size *= EDSCALE;
mesh_library_palette->set_fixed_icon_size(Size2(min_size, min_size));
- mesh_library_palette->set_fixed_column_width(min_size * MAX(size_slider->get_value(), 1.5));
mesh_library_palette->set_max_text_lines(2);
Ref<MeshLibrary> mesh_library = node->get_mesh_library();