From 4ba8acaf08f220dcd144bc79b7f9eca8e7d5f4ba Mon Sep 17 00:00:00 2001 From: Shin Yamamoto Date: Mon, 19 Oct 2020 19:20:16 +0900 Subject: [PATCH] Ease the default velocity for a panel removal (#395) Because the current threshold(10.0) makes it hard to remove a panel. Resolve #389 --- Sources/Core.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/Core.swift b/Sources/Core.swift index 1f50d352..8dfd55c9 100644 --- a/Sources/Core.swift +++ b/Sources/Core.swift @@ -718,15 +718,16 @@ class Core: NSObject, UIGestureRecognizerDelegate { if let result = vc.delegate?.floatingPanel?(vc, shouldRemoveAt: vc.surfaceLocation, with: velocityVector) { return result } + let threshold = CGFloat(5.5) switch layoutAdapter.position { case .top: - return (velocityVector.dy <= -10.0) + return (velocityVector.dy <= -threshold) case .left: - return (velocityVector.dx <= -10.0) + return (velocityVector.dx <= -threshold) case .bottom: - return (velocityVector.dy >= 10.0) + return (velocityVector.dy >= threshold) case .right: - return (velocityVector.dx >= 10.0) + return (velocityVector.dx >= threshold) } }