From 127c2d75ad109fe4a905f9061fcbc25d1e8b0ca9 Mon Sep 17 00:00:00 2001 From: Muller-Castro <37383316+Muller-Castro@users.noreply.github.com> Date: Sat, 19 Oct 2019 17:33:39 -0300 Subject: Fixed TouchScreenButton::shape_centered having no effect The problem was that the shape_centered depended on TouchScreenButton::texture having a Texture --- scene/2d/touch_screen_button.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 9a1a759e72..cf68528388 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -325,8 +325,12 @@ void TouchScreenButton::_release(bool p_exiting_tree) { } Rect2 TouchScreenButton::_edit_get_rect() const { - if (texture.is_null()) - return CanvasItem::_edit_get_rect(); + if (texture.is_null()) { + if (shape.is_valid()) + return shape->get_rect(); + else + return CanvasItem::_edit_get_rect(); + } return Rect2(Size2(), texture->get_size()); } -- cgit v1.2.3