summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2023-09-06 16:39:06 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2023-09-06 16:39:06 +0200
commit380db4d03eee724ff3139214f7d76e33b8f1cf6d (patch)
tree9adc35fc74e26929c521aa13a40bd78e2eeb53ea
parent8449592d92eaeef990f5502b419d491ee3eeb7a6 (diff)
downloadredot-engine-380db4d03eee724ff3139214f7d76e33b8f1cf6d.tar.gz
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.
-rw-r--r--scene/gui/button.cpp6
-rw-r--r--scene/gui/texture_rect.cpp6
2 files changed, 4 insertions, 8 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 738778b516..a94b12541e 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -554,10 +554,8 @@ void Button::set_icon(const Ref<Texture2D> &p_icon) {
}
void Button::_texture_changed() {
- if (icon.is_valid()) {
- queue_redraw();
- update_minimum_size();
- }
+ queue_redraw();
+ update_minimum_size();
}
Ref<Texture2D> Button::get_icon() const {
diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp
index d94b11789f..c52f463905 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<Texture2D> &p_tex) {