Fixing visual glitch on maxProgress display

Considering maxProgress an integer
This commit is contained in:
Gabriel Moreira Minossi 2021-01-16 17:12:43 -03:00
parent 9d829867e1
commit 711d96108c

View File

@ -92,7 +92,8 @@ local function draw(self, index)
DoubleBuffer.drawText(
x - 3 - 3 + width - Unicode.len(middleInfo) -
Unicode.len(
Utility.splitNumber(self.progress) .. " / " .. Utility.splitNumber(self.maxProgress) .. " s"
Utility.splitNumber(math.floor(self.progress)) ..
" / " .. Utility.splitNumber(math.floor(self.maxProgress)) .. " s"
),
y + height - 3,
Colors.textColor,
@ -101,11 +102,15 @@ local function draw(self, index)
end
DoubleBuffer.drawText(
x + width -
Unicode.len(Utility.splitNumber(self.progress) .. " / " .. Utility.splitNumber(self.maxProgress) .. " s") -
Unicode.len(
Utility.splitNumber(math.floor(self.progress)) ..
" / " .. Utility.splitNumber(math.floor(self.maxProgress)) .. " s"
) -
3,
y + height - 3,
Colors.accentA,
Utility.splitNumber(self.progress) .. " / " .. Utility.splitNumber(self.maxProgress) .. " s"
Utility.splitNumber(math.floor(self.progress)) ..
" / " .. Utility.splitNumber(math.floor(self.maxProgress)) .. " s"
)
end
end