Skip to content

Commit

Permalink
Merge pull request #50777 from KoBeWi/Schrödinger's-Label
Browse files Browse the repository at this point in the history
Don't set metadata_label font if it doesn't exist
  • Loading branch information
akien-mga committed Jul 23, 2021
2 parents 8cddd3b + 2846dbf commit d17201a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions editor/plugins/texture_editor_plugin.cpp
Expand Up @@ -48,8 +48,10 @@ void TexturePreview::_notification(int p_what) {
break;
}

Ref<Font> metadata_label_font = get_theme_font(SNAME("expression"), SNAME("EditorFonts"));
metadata_label->add_theme_font_override("font", metadata_label_font);
if (metadata_label) {
Ref<Font> metadata_label_font = get_theme_font(SNAME("expression"), SNAME("EditorFonts"));
metadata_label->add_theme_font_override("font", metadata_label_font);
}

checkerboard->set_texture(get_theme_icon(SNAME("Checkerboard"), SNAME("EditorIcons")));
} break;
Expand Down
6 changes: 3 additions & 3 deletions editor/plugins/texture_editor_plugin.h
Expand Up @@ -39,10 +39,10 @@ class TexturePreview : public MarginContainer {
GDCLASS(TexturePreview, MarginContainer);

private:
TextureRect *texture_display;
TextureRect *texture_display = nullptr;

TextureRect *checkerboard;
Label *metadata_label;
TextureRect *checkerboard = nullptr;
Label *metadata_label = nullptr;

protected:
void _notification(int p_what);
Expand Down

0 comments on commit d17201a

Please sign in to comment.