On-the-fly scans for X-ray ptychography