Merge pull request 'fix edge case where songwheel would break if there is no song in index' (#7) from bugfix/filterwheel-collections-no-song-fix into master

Reviewed-on: #7
This commit is contained in:
Kuenaimaku 2022-03-23 22:53:48 +00:00
commit c76e174b58
1 changed files with 3 additions and 2 deletions

View File

@ -775,7 +775,6 @@ function drawScrollbar()
gfx.ImageRect(fillXPos, scrollbarYPos, sw, sh, scrollBarFillImage, 1, 0);
-- 1st letter of song title on scroll
local letter = string.upper(common.firstLetter(songwheel.songs[selectedIndex].title));
gfx.BeginPath()
gfx.FontSize(16)
gfx.LoadSkinFont('Digital-Serial-Bold.ttf')
@ -784,8 +783,10 @@ function drawScrollbar()
gfx.Fill()
gfx.FillColor(255,255,255)
gfx.TextAlign(gfx.TEXT_ALIGN_MIDDLE + gfx.TEXT_ALIGN_CENTER)
if (songwheel.songs[selectedIndex] ~= nil) then
local letter = string.upper(common.firstLetter(songwheel.songs[selectedIndex].title));
gfx.Text(letter, fillXPos-10, scrollbarYPos + 5);
end
end
function refreshIrLeaderboard(deltaTime)