mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 02:56:36 -04:00
6bddaab930
auto_ui_squash squashes each spatial run of UI primitives about that run's own anchor, so a HUD element split across two runs gets two anchors and comes apart as the frame widens -- elements drifting toward opposite edges, glyphs sliding off the background box they sit on. Diagnosing that required knowing which run each primitive landed in, and nothing exposed it. The two things an observer could reach were both insufficient: group.key is a hash of CLUT/texpage/Y-band/family, so unequal keys say two prims differ without saying WHICH component differed; and the anchor takes only three values (left/centre/right thirds), so equal anchors do not prove two prims actually co-grouped rather than coincidentally landing on the same third. ws_ui_groups dumps, for the last prepass, each primitive's op / key / raw key inputs (y, h, and the derived 24px band and poly-vs-rect family) / union-find root / final anchor, plus the frame-level active, squash, dense, rank, disp_x, disp_w and join_gap. Root plus raw inputs together answer "did these two merge, and if not, what split them". Carries two small support changes: - WsUiGroupItem gains a diagnostic `root`, written by ws_ui_group_assign in all three paths (dense, alloc-failure fallback, and the union-find path). Never read by the transform path. - WsUiPrepassItem retains y/h/op, which the key otherwise folds away. Read-only and query-driven, per the ring-buffer rule: capture is continuous and the observer asks for a window later.