Merge pull request #32927 from Muller-Castro/ShapeCenteredFix

Fixed TouchScreenButton::shape_centered having no effect
This commit is contained in:
Rémi Verschelde 2019-10-22 15:53:29 +02:00 committed by GitHub
commit 4ecc30cc5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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());
}