timeline: Snap playhead to snap points when dragging in ruler
Summary
When dragging the time cursor (playhead) in the timeline ruler, it now snaps to nearby snap points . clip edges, guides, markers, and zone in/out, just like clips do when dragged.
Previously, the playhead moved freely with no snapping at all when dragged. This made it tedious to precisely position the playhead at meaningful timeline positions using only the mouse.
Implementation notes
The naive approach of reusing the existing suggestSnapPoint() caused the playhead to snap at seemingly random equal intervals even in empty areas of the timeline. The root cause: suggestSnapPoint() temporarily adds the current cursor position to the snap model before querying it. When dragging the playhead, the current position is always nearby, so it kept snapping back to itself. making movement feel jerky and unpredictable.
The fix is a dedicated suggestPlayheadSnapPoint() in TimelineModel that queries m_snaps->getClosestPoint() directly without injecting the cursor position. This gives clean, smooth movement that only snaps when a real snap point (clip edge, guide, marker, zone boundary) is within the zoom-aware proximity threshold.
How to test
- Add clips and guides to the timeline
- Enable snapping (magnet icon)
- Drag the playhead, it should snap cleanly to clip edges and guides
- Drag in empty space, should move freely with no snapping
- Hold Shift while dragging and snapping should be temporarily disabled
Fixes BUG: 503693