mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix EditorNode::drag_resource crash.
This commit is contained in:
parent
19bb18716e
commit
44400b1419
1 changed files with 7 additions and 5 deletions
|
|
@ -6035,11 +6035,13 @@ Dictionary EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from
|
||||||
|
|
||||||
{
|
{
|
||||||
// TODO: make proper previews
|
// TODO: make proper previews
|
||||||
Ref<ImageTexture> texture = theme->get_icon(SNAME("FileBigThumb"), EditorStringName(EditorIcons));
|
Ref<Texture2D> texture = theme->get_icon(SNAME("FileBigThumb"), EditorStringName(EditorIcons));
|
||||||
Ref<Image> img = texture->get_image();
|
if (texture.is_valid()) {
|
||||||
img = img->duplicate();
|
Ref<Image> img = texture->get_image();
|
||||||
img->resize(48, 48); // meh
|
img = img->duplicate();
|
||||||
preview = ImageTexture::create_from_image(img);
|
img->resize(48, 48); // meh
|
||||||
|
preview = ImageTexture::create_from_image(img);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drag_preview->set_texture(preview);
|
drag_preview->set_texture(preview);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue