/ top and bottom gaps on songwheel if there aren't many songs to fill it

This commit is contained in:
FajsiEx 2021-08-12 22:34:38 +02:00
parent 94803d5b92
commit 3a5e348d2c
1 changed files with 8 additions and 0 deletions

View File

@ -163,6 +163,14 @@ end
function getCorrectedIndex(from, offset) function getCorrectedIndex(from, offset)
total = #songwheel.songs; total = #songwheel.songs;
if (math.abs(offset) > total) then
if (offset < 0) then
offset = offset + total*math.floor(math.abs(offset)/total);
else
offset = offset - total*math.floor(math.abs(offset)/total);
end
end
index = from + offset; index = from + offset;
if index < 1 then if index < 1 then