diff options
Diffstat (limited to 'scene/2d/touch_screen_button.cpp')
-rw-r--r-- | scene/2d/touch_screen_button.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index ff409272c5..220608a250 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -185,6 +185,7 @@ void TouchScreenButton::_notification(int p_what) { } } break; + case NOTIFICATION_SUSPENDED: case NOTIFICATION_PAUSED: { if (is_pressed()) { _release(); @@ -329,7 +330,7 @@ void TouchScreenButton::_release(bool p_exiting_tree) { } } -#ifdef TOOLS_ENABLED +#ifdef DEBUG_ENABLED Rect2 TouchScreenButton::_edit_get_rect() const { if (texture_normal.is_null()) { return CanvasItem::_edit_get_rect(); @@ -341,7 +342,7 @@ Rect2 TouchScreenButton::_edit_get_rect() const { bool TouchScreenButton::_edit_use_rect() const { return !texture_normal.is_null(); } -#endif +#endif // DEBUG_ENABLED Rect2 TouchScreenButton::get_anchorable_rect() const { if (texture_normal.is_null()) { @@ -429,6 +430,6 @@ void TouchScreenButton::_bind_methods() { } TouchScreenButton::TouchScreenButton() { - unit_rect = Ref<RectangleShape2D>(memnew(RectangleShape2D)); + unit_rect.instantiate(); unit_rect->set_size(Vector2(1, 1)); } |