Improve pan gesture