diff options
author | Muller-Castro <37383316+Muller-Castro@users.noreply.github.com> | 2019-10-19 17:33:39 -0300 |
---|---|---|
committer | Muller-Castro <37383316+Muller-Castro@users.noreply.github.com> | 2019-10-19 18:16:47 -0300 |
commit | 127c2d75ad109fe4a905f9061fcbc25d1e8b0ca9 (patch) | |
tree | 43129365677a4de787a829dd64279906af18ed31 /scene/2d | |
parent | 119bf237209414a49879fba40459f22315ab1467 (diff) |
Fixed TouchScreenButton::shape_centered having no effect
The problem was that the shape_centered depended on TouchScreenButton::texture having a Texture
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/touch_screen_button.cpp | 8 |
1 files 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()); } |