Skip to content

Commit

Permalink
Ease the default velocity for a panel removal (#395)
Browse files Browse the repository at this point in the history
Because the current threshold(10.0) makes it hard to remove a panel.

Resolve #389
  • Loading branch information
scenee authored Oct 19, 2020
1 parent 02d8d45 commit 4ba8aca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 4ba8aca

Please sign in to comment.