Skip to main content

components

Function components 

Source
pub fn components(cells: &[(i32, i32)], size: i32) -> Vec<Component>
Expand description

Mirrors Compositor.components (src/core/compositor.ts): 8-connected components of cells, absolute block coordinates. cells must already be in the caller’s chosen seed order (TS sorts by tile-then-local-block order before calling); a HashSet has no ordering guarantee, so a component’s seed is the first cells entry not yet claimed by an earlier component, walked in that same order — matching cells.values().next().value on a Set built from the same sorted array. Within a component, block order does not affect the result (the caller only ever treats it as a set).