         
         translation = delta
         
+        if delta.x * displacement.x >= 0 {
+            
+            displacement.x += delta.x
+            movementDuration += time
+            
+        } else {
+            
+            displacement.x = delta.x;
+            movementDuration = time
+        }
         
+        if delta.y * displacement.y >= 0 {
+            
+            displacement.y += delta.y
+            movementDuration += time
+            
+        } else {
+            
+            displacement.y = delta.y
+            movementDuration = time
+        }
         
         lastMovement = event.timestamp
         

        return translation
    }
    
    // MARK: - Internal
    
    private var lastMovement: TimeInterval?

            
        }
    }
    
    public override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
        
        switch self.state {
            
        case .changed:
            
            let time = event.timestamp - (lastMovement ?? 0)
            
            if time > 0.2 {
                
                self.velocity = .zero
                
            } else {
                
                self.velocity.x = displacement.x / CGFloat(movementDuration > 0 ? movementDuration : 0.001)
                self.velocity.y = displacement.y / CGFloat(movementDuration > 0 ? movementDuration : 0.001)
            }
            
            self.state = .ended
            
        default:
            
            self.state = .failed
        }
    }
}
