Skip to content

Commit

Permalink
Merge pull request #81383 from AThousandShips/valid_remove
Browse files Browse the repository at this point in the history
Remove unnecessary validity checks from `Button` and `TextureRect`
  • Loading branch information
akien-mga committed Sep 7, 2023
2 parents 632bbc6 + 380db4d commit 4bf3de7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions scene/gui/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 2 additions & 4 deletions scene/gui/texture_rect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4bf3de7

Please sign in to comment.