diff options
Diffstat (limited to 'scene/2d/screen_button.cpp')
-rw-r--r-- | scene/2d/screen_button.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 9480f18176..45f63fd5bf 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -324,19 +324,21 @@ void TouchScreenButton::_release(bool p_exiting_tree) { } Rect2 TouchScreenButton::_edit_get_rect() const { - - if (texture.is_null()) - return Rect2(0, 0, 1, 1); - /* if (texture.is_null()) return CanvasItem::_edit_get_rect(); - */ return Rect2(Size2(), texture->get_size()); } bool TouchScreenButton::_edit_use_rect() const { - return true; + return !texture.is_null(); +} + +Rect2 TouchScreenButton::get_anchorable_rect() const { + if (texture.is_null()) + return CanvasItem::get_anchorable_rect(); + + return Rect2(Size2(), texture->get_size()); } void TouchScreenButton::set_visibility_mode(VisibilityMode p_mode) { |