diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-08 16:50:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-08 16:50:47 +0200 |
commit | d26442e709f6361af9ac755ec9291bb43f2cd69b (patch) | |
tree | f84384f85f9f4a329ffd892b4a6a238e932f161e /scene/resources/default_theme | |
parent | 697805af54f3d25195617a513e18ec3a4f9fe0c6 (diff) | |
parent | d2900429e81175a9f48240b180f1d8e3ab52865c (diff) |
Merge pull request #60739 from KoBeWi/add_static_methods_everywhere!!
Diffstat (limited to 'scene/resources/default_theme')
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 9d13ac3a38..520a0a04ed 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -76,7 +76,6 @@ static Ref<StyleBoxFlat> sb_expand(Ref<StyleBoxFlat> p_sbox, float p_left, float // See also `editor_generate_icon()` in `editor/editor_themes.cpp`. static Ref<ImageTexture> generate_icon(int p_index) { - Ref<ImageTexture> icon = memnew(ImageTexture); Ref<Image> img = memnew(Image); #ifdef MODULE_SVG_ENABLED @@ -87,9 +86,8 @@ static Ref<ImageTexture> generate_icon(int p_index) { ImageLoaderSVG img_loader; img_loader.create_image_from_string(img, default_theme_icons_sources[p_index], scale, upsample, false); #endif - icon->create_from_image(img); - return icon; + return ImageTexture::create_from_image(img); } static Ref<StyleBox> make_empty_stylebox(float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_bottom = -1) { |