Skip to main content

layout_peer_pills

Function layout_peer_pills 

pub fn layout_peer_pills(
    viewport: Rect,
    pills: &[PillRequest],
) -> Vec<PillPlacement>
Expand description

Place one name pill per peer so none overlap and none leaves viewport. Each pill tries the four corners around its pointer, taking the first clear of the viewport and every already-placed pill; only when all four are taken does it slide along the vertical and get marked tethered. Placement order is by position, not arrival, so a peer reconnecting doesn’t reshuffle everyone else’s names.