GreedyLabelLayout

Greedy placement by priority with candidate positions (§FVL-4).

In the namespace utility::ui. Declared in src/libs/libutil/utility/ui/AnchoredLabels.hpp.

Detailed description

Eight candidate box positions around each point, at two leader lengths. The anchors sort by priority, then by id; pinned anchors first. Each box takes the first free candidate, the one of the last frame first while it is free, so a label does not jump during an orbit. A uniform grid of buckets holds the placed boxes, so a test of a collision reads a few cells: O(N · k). At most kMaxTextBoxes boxes with text; an anchor over the cap draws its dot only, and a pinned one is never over it. A box never leaves the viewport.

In this section