From 380db4d03eee724ff3139214f7d76e33b8f1cf6d Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:39:06 +0200 Subject: [PATCH] Remove unnecessary validity checks from `Button` and `TextureRect` The one in `TextureRect` appears to be a leftover from earlier code, and the one in `Button` was copied from there. --- scene/gui/button.cpp | 6 ++---- scene/gui/texture_rect.cpp | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 738778b51699..a94b12541ef4 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -554,10 +554,8 @@ void Button::set_icon(const Ref &p_icon) { } void Button::_texture_changed() { - if (icon.is_valid()) { - queue_redraw(); - update_minimum_size(); - } + queue_redraw(); + update_minimum_size(); } Ref Button::get_icon() const { diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp index d94b11789f88..c52f463905bc 100644 --- a/scene/gui/texture_rect.cpp +++ b/scene/gui/texture_rect.cpp @@ -189,10 +189,8 @@ bool TextureRect::_set(const StringName &p_name, const Variant &p_value) { #endif void TextureRect::_texture_changed() { - if (texture.is_valid()) { - queue_redraw(); - update_minimum_size(); - } + queue_redraw(); + update_minimum_size(); } void TextureRect::set_texture(const Ref &p_tex) {