Selaa lähdekoodia

Merge pull request #57040 from YeldhamDev/drag_script_fix

Fix icon in drag preview of scripts/docs
Rémi Verschelde 3 vuotta sitten
vanhempi
commit
3a41bf0e04
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      editor/plugins/script_editor_plugin.cpp

+ 1 - 0
editor/plugins/script_editor_plugin.cpp

@@ -2794,6 +2794,7 @@ Variant ScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
 	if (!preview_icon.is_null()) {
 	if (!preview_icon.is_null()) {
 		TextureRect *tf = memnew(TextureRect);
 		TextureRect *tf = memnew(TextureRect);
 		tf->set_texture(preview_icon);
 		tf->set_texture(preview_icon);
+		tf->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
 		drag_preview->add_child(tf);
 		drag_preview->add_child(tf);
 	}
 	}
 	Label *label = memnew(Label(preview_name));
 	Label *label = memnew(Label(preview_name));