only check position in the moving direction (close #25)