dev: optimize pan gesture handler