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.
This commit is contained in:
@ -554,11 +554,9 @@ void Button::set_icon(const Ref<Texture2D> &p_icon) {
|
||||
}
|
||||
|
||||
void Button::_texture_changed() {
|
||||
if (icon.is_valid()) {
|
||||
queue_redraw();
|
||||
update_minimum_size();
|
||||
}
|
||||
}
|
||||
|
||||
Ref<Texture2D> Button::get_icon() const {
|
||||
return icon;
|
||||
|
||||
@ -189,11 +189,9 @@ 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();
|
||||
}
|
||||
}
|
||||
|
||||
void TextureRect::set_texture(const Ref<Texture2D> &p_tex) {
|
||||
if (p_tex == texture) {
|
||||
|
||||
Reference in New Issue
Block a user