In the building menu two building overlap (gas burner and transport hub) #136
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Done in
ea25318. Reproduced exactly as reported, and the cause is worth writing down because it was a bug waiting for the tenth structure.The menu's rows were a written-down list of tops, read as
tops[mini(row, tops.size() - 1)]. With every structure researched there are ten entries in three columns - four rows - and the list had three tops. The clamp put row 3 on row 2's position, and in that column order the tenth entry (gas burner) landed exactly on the middle of row 2 (transport hub). Identical rectangles, not merely overlapping ones.A list that silently stacks whatever will not fit in it is not a layout, so it is computed now: a first top and a pitch that tightens when the band is short, floored at the row's own height - which is the guarantee that two rows can never occupy the same space however far the catalog grows. And the column count widens rather than adding a row the band cannot hold, so ten structures now sit in four columns of three rows instead of three columns of four.
The regression test unlocks the whole skill tree and checks every pair of visible entries - button, caption and price - for overlap. That is the shape of the bug rather than a coordinate that happens to be right today; it fails on the old code and keeps failing if the eleventh building brings the problem back.