The text in the ship menu from the mothership to assign to the fleet is bad, text below buttons overlap the icon just below #143

Closed
opened 2026-08-28 13:43:30 +00:00 by metaheavens · 1 comment
Owner
No description provided.
Author
Owner

Done in 2206b55.

A hangar caption is "Gas Bomber\n2 available" - two lines before autowrap, three after it once the column is narrow - at a font size fixed in the scene. Godot Labels do not clip by default, so the third line was simply drawn over the icon of the row below.

Two changes, and both are wanted. The size is fitted to the box the layout works out, so the text has somewhere to go and stays legible; and the box clips, so however the catalog grows - a longer vessel name, a fourth line - nothing can reach the next row again. The first keeps it readable, the second keeps it correct.

Measuring for the test turned up a second, smaller fault in the same place: the caption's box overhung its own cell by exactly HANGAR_LABEL_GAP, because the layout subtracted one gap where it needed two - above the caption and below it. Two pixels, but two pixels inside the next row's icon, so with clipping switched on the caption would have been allowed to draw there.

The test measures the text with the real font at the real size and fails if it needs more height than the box has, and separately checks no caption box intersects an icon below it.

Suite: 145/145.

Done in `2206b55`. A hangar caption is `"Gas Bomber\n2 available"` - two lines before autowrap, three after it once the column is narrow - at a font size fixed in the scene. Godot Labels do not clip by default, so the third line was simply drawn over the icon of the row below. Two changes, and both are wanted. The size is fitted to the box the layout works out, so the text has somewhere to go and stays legible; and the box clips, so however the catalog grows - a longer vessel name, a fourth line - nothing can reach the next row again. The first keeps it readable, the second keeps it correct. Measuring for the test turned up a second, smaller fault in the same place: the caption's box overhung its own cell by exactly `HANGAR_LABEL_GAP`, because the layout subtracted one gap where it needed two - above the caption and below it. Two pixels, but two pixels *inside* the next row's icon, so with clipping switched on the caption would have been allowed to draw there. The test measures the text with the real font at the real size and fails if it needs more height than the box has, and separately checks no caption box intersects an icon below it. Suite: 145/145.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
metaheavens/spaceship#143
No description provided.