phosphor-geometry

Pure-function geometry helpers shared by both engines.

Zone clamping, overlap resolution, per-window minimum-size enforcement, and the canonical rect-to-JSON encoder. Both the snap engine and the autotile engine post-process algorithm output through these helpers before handing rects to the compositor; keeping them in a leaf lib means neither engine ships a private copy and headless geometry tests link without GUI infrastructure.

Full API →

Key types

enforceMinSizes
Grow zones to fit per-window minimums by stealing surplus from neighbours, then resolve overlap.
clampZonesToScreen
Position-only clamp; shifts zones to stay on screen, sizes preserved.
removeRectOverlaps
Resolve residual overlap between zones after min-size growth.
rectToJson
Canonical rect-string format for D-Bus + JSON roundtrip.

Dependencies

References