         } else {
             switch self.direction {
             case .top, .bottom:
-                bounds = self.targetView.bounds.height
+                bounds = self.panFrameSize != nil ? self.panFrameSize!.height : self.targetView.bounds.height
             case .left, .right:
-                bounds = self.targetView.bounds.width
+                bounds = self.panFrameSize != nil ? self.panFrameSize!.width : self.targetView.bounds.width
             }
         }
         switch self.direction {

    public var panCompletionThreshold: CGFloat = 30.0
    public var velocityThreshold: CGFloat = 0.0
    public var panBoundsPoint: CGPoint?
    
    fileprivate let targetView: UIView
    

            self.panLocationStart = location.y
        case .bottom:
            if self.targetView is UIScrollView {
                self.panLocationStart = location.y
            } else {
                self.panLocationStart = location.y
