diff options
-rw-r--r-- | doc/classes/TouchScreenButton.xml | 2 | ||||
-rw-r--r-- | scene/2d/touch_screen_button.cpp | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index fccfb4cd6d..3d18534a68 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -37,7 +37,7 @@ The button's shape. </member> <member name="shape_centered" type="bool" setter="set_shape_centered" getter="is_shape_centered" default="true"> - If [code]true[/code], the button's shape is centered. + If [code]true[/code], the button's shape is centered in the provided texture. If no texture is used, this property has no effect. </member> <member name="shape_visible" type="bool" setter="set_shape_visible" getter="is_shape_visible" default="true"> If [code]true[/code], the button's shape is visible. diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index cf68528388..9a1a759e72 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -325,12 +325,8 @@ void TouchScreenButton::_release(bool p_exiting_tree) { } Rect2 TouchScreenButton::_edit_get_rect() const { - if (texture.is_null()) { - if (shape.is_valid()) - return shape->get_rect(); - else - return CanvasItem::_edit_get_rect(); - } + if (texture.is_null()) + return CanvasItem::_edit_get_rect(); return Rect2(Size2(), texture->get_size()); } |