Add expand mode compat to TextureRect
This commit is contained in:
parent
228db366bf
commit
54abd5b560
|
@ -178,6 +178,16 @@ void TextureRect::_bind_methods() {
|
||||||
BIND_ENUM_CONSTANT(STRETCH_KEEP_ASPECT_COVERED);
|
BIND_ENUM_CONSTANT(STRETCH_KEEP_ASPECT_COVERED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef DISABLE_DEPRECATED
|
||||||
|
bool TextureRect::_set(const StringName &p_name, const Variant &p_value) {
|
||||||
|
if ((p_name == SNAME("expand") || p_name == SNAME("ignore_texture_size")) && p_value.operator bool()) {
|
||||||
|
expand_mode = EXPAND_IGNORE_SIZE;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void TextureRect::_texture_changed() {
|
void TextureRect::_texture_changed() {
|
||||||
if (texture.is_valid()) {
|
if (texture.is_valid()) {
|
||||||
queue_redraw();
|
queue_redraw();
|
||||||
|
|
|
@ -69,6 +69,9 @@ protected:
|
||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
virtual Size2 get_minimum_size() const override;
|
virtual Size2 get_minimum_size() const override;
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
#ifndef DISABLE_DEPRECATED
|
||||||
|
bool _set(const StringName &p_name, const Variant &p_value);
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_texture(const Ref<Texture2D> &p_tex);
|
void set_texture(const Ref<Texture2D> &p_tex);
|
||||||
|
|
Loading…
Reference in New Issue