Fix: Wrong row may be selected in music playlists. (#14581)

Include frame offset when clicking on music playlist to ensure the correct row is selected.
This commit is contained in:
Peter Nelson
2025-09-03 19:02:26 +01:00
committed by dP
parent 9ce4aef266
commit f9a281a794

View File

@@ -582,13 +582,13 @@ struct MusicTrackSelectionWindow : public Window {
{
switch (widget) {
case WID_MTS_LIST_LEFT: { // add to playlist
int y = this->GetRowFromWidget(pt.y, widget, 0, GetCharacterHeight(FS_SMALL));
int y = this->GetRowFromWidget(pt.y, widget, WidgetDimensions::scaled.framerect.top, GetCharacterHeight(FS_SMALL));
_music.PlaylistAdd(y);
break;
}
case WID_MTS_LIST_RIGHT: { // remove from playlist
int y = this->GetRowFromWidget(pt.y, widget, 0, GetCharacterHeight(FS_SMALL));
int y = this->GetRowFromWidget(pt.y, widget, WidgetDimensions::scaled.framerect.top, GetCharacterHeight(FS_SMALL));
_music.PlaylistRemove(y);
break;
}