1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-03 11:59:15 +00:00

Fix #14569: Ensure music playlist window is large enough. (#14570)

Take number of tracks allowed in custom playlist into account, instead of just the number of tracks loaded.
This commit is contained in:
2025-09-02 20:18:33 +01:00
committed by GitHub
parent dd426bb8c7
commit 7d4282b341

View File

@@ -539,10 +539,10 @@ struct MusicTrackSelectionWindow : public Window {
Dimension d = {0, 0};
for (const auto &song : _music.music_set) {
Dimension d2 = GetStringBoundingBox(GetString(STR_PLAYLIST_TRACK_NAME, song.tracknr, 2, song.songname));
d.width = std::max(d.width, d2.width);
d.height += d2.height;
d = maxdim(d, GetStringBoundingBox(GetString(STR_PLAYLIST_TRACK_NAME, song.tracknr, 2, song.songname)));
}
d.height *= std::max(NUM_SONGS_AVAILABLE, NUM_SONGS_PLAYLIST);
d.width += padding.width;
d.height += padding.height;
size = maxdim(size, d);