Defensive code to prevent double drawing progress bar

This commit is contained in:
1hitsong 2023-04-13 19:17:23 -04:00
parent 089788abab
commit 6c446ff2e1

View File

@ -238,6 +238,11 @@ end sub
' '
' Draws and animates item progress bar ' Draws and animates item progress bar
sub drawProgressBar(itemData) sub drawProgressBar(itemData)
' Don't redraw progress bar if it's already been drawn
' Allow a slight tolerance for rounding issues.
if abs(m.itemProgress.width - (m.itemPoster.width * (itemData.PlayedPercentage / 100))) < 5 then return
m.itemProgressBackground.width = itemData.imageWidth m.itemProgressBackground.width = itemData.imageWidth
m.itemProgressBackground.visible = true m.itemProgressBackground.visible = true
m.showProgressBarField.keyValue = [0, m.itemPoster.width * (itemData.PlayedPercentage / 100)] m.showProgressBarField.keyValue = [0, m.itemPoster.width * (itemData.PlayedPercentage / 100)]