Add a new method to detect dragging direction