Skip to main content

snap_span

Function snap_span 

Source
pub fn snap_span(
    scale: &TimeScale,
    start: f64,
    length: f64,
    targets: &SnapTargets,
    reach: f64,
) -> (f64, Snapped)
Expand description

Where a span length long starting near start snaps: whichever of its edges is nearer a point within reach lands on it; otherwise its start goes onto the grid (or the scale’s units). Its new start, and what it snapped to.