Don't set metadata_label font if it doesn't exist
(cherry picked from commit 2846dbf239
)
This commit is contained in:
parent
7968208b0a
commit
49f323410b
|
@ -49,11 +49,13 @@ void TexturePreview::_notification(int p_what) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (metadata_label) {
|
||||
Ref<DynamicFont> metadata_label_font = get_font("expression", "EditorFonts")->duplicate();
|
||||
metadata_label_font->set_size(16 * EDSCALE);
|
||||
metadata_label_font->set_outline_size(2 * EDSCALE);
|
||||
metadata_label_font->set_outline_color(Color::named("black"));
|
||||
metadata_label->add_font_override("font", metadata_label_font);
|
||||
}
|
||||
|
||||
checkerboard->set_texture(get_icon("Checkerboard", "EditorIcons"));
|
||||
} break;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue