Sdl2-client scales unit icons too much to citydlg. They don't nearly fill the space reserved for them.
While get_smaller_surface_rect() has problems, the main culprit here seems to be the fact that create_unit_surface() ignores the height returned by it completely. It does that for the purpose of keeping the space reserved for upkeep icons, but it does that even when no upkeep icons are to be shown.
Both of these issues need to be fixed in order to see any results ( get_smaller_surface_rect() should return correct rect, and it should be used correctly)
Sdl2-client scales unit icons too much to citydlg. They don't nearly fill the space reserved for them.
While get_smaller_surface_rect() has problems, the main culprit here seems to be the fact that create_unit_surface() ignores the height returned by it completely. It does that for the purpose of keeping the space reserved for upkeep icons, but it does that even when no upkeep icons are to be shown.