summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index da8bf39f62..64665833df 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4043,10 +4043,8 @@ Ref<ImageTexture> EditorNode::_load_custom_class_icon(const String &p_path) cons
Ref<Image> img = memnew(Image);
Error err = ImageLoader::load_image(p_path, img);
if (err == OK) {
- Ref<ImageTexture> icon = memnew(ImageTexture);
img->resize(16 * EDSCALE, 16 * EDSCALE, Image::INTERPOLATE_LANCZOS);
- icon->create_from_image(img);
- return icon;
+ return ImageTexture::create_from_image(img);
}
}
return nullptr;
@@ -5393,9 +5391,7 @@ Variant EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from) {
Ref<Image> img = texture->get_image();
img = img->duplicate();
img->resize(48, 48); // meh
- Ref<ImageTexture> resized_pic = Ref<ImageTexture>(memnew(ImageTexture));
- resized_pic->create_from_image(img);
- preview = resized_pic;
+ preview = ImageTexture::create_from_image(img);
}
drag_preview->set_texture(preview);