From 4689ece7415be4a598e5a881d64b1201bf8ce0e0 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Mon, 30 Sep 2019 13:36:49 -0300 Subject: [PATCH] Minor visual adjustment in drag preview of the scene and file tree editors --- editor/editor_node.cpp | 3 ++- editor/scene_tree_editor.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 05b50d5dfe3..2c3a84857a8 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4891,7 +4891,7 @@ Variant EditorNode::drag_files_and_dirs(const Vector &p_paths, Control * } int max_rows = 6; - int num_rows = p_paths.size() > max_rows ? max_rows - 1 : p_paths.size(); //Don't waste a row to say "1 more file" - list it instead. + int num_rows = p_paths.size() > max_rows ? max_rows - 1 : p_paths.size(); // Don't waste a row to say "1 more file" - list it instead. VBoxContainer *vbox = memnew(VBoxContainer); for (int i = 0; i < num_rows; i++) { HBoxContainer *hbox = memnew(HBoxContainer); @@ -4905,6 +4905,7 @@ Variant EditorNode::drag_files_and_dirs(const Vector &p_paths, Control * label->set_text(p_paths[i].get_file()); icon->set_texture(gui_base->get_icon("File", "EditorIcons")); } + icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED); icon->set_size(Size2(16, 16)); hbox->add_child(icon); hbox->add_child(label); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index f1fc4eb9506..dc5eb4bbd07 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -959,6 +959,7 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from HBoxContainer *hb = memnew(HBoxContainer); TextureRect *tf = memnew(TextureRect); tf->set_texture(icons[i]); + tf->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED); hb->add_child(tf); Label *label = memnew(Label(selected[i]->get_name())); hb->add_child(label);