Skip to main content

count_leading_in_rect

Function count_leading_in_rect 

Source
pub fn count_leading_in_rect(
    path: &[(i32, i32)],
    box_x: i32,
    box_y: i32,
    box_w: u16,
    box_h: u16,
) -> usize
Expand description

Count cells at the START of path whose canvas-grid coords lie inside the rect (box_x, box_y, box_w, box_h). Used by the edge renderer + the unlock-anim’s completion check to skip the “inside the source box” prefix when seeding the wavefront. Iteration stops at the first cell that’s outside the rect — interior gaps don’t inflate the count.