Fix calculator character conversion

This commit is contained in:
Smok1e 2024-01-29 06:23:50 +03:00
parent 4a8ffa4d51
commit 53e98b6636

View File

@ -136,8 +136,12 @@ displayWidget.draw = function()
end
-- Char
local char = charList.selectedItem == 1
and (absValue <= 0x10FFFF and unicode.char(absValue) or "?")
or (absValue <= 0xFF and string.char (absValue) or "?")
screen.drawText(displayWidget.x, y, 0x696969, "\"")
screen.drawText(displayWidget.x + 1, y, 0xFFFFFF, charList.selectedItem == 1 and unicode.char(absValue) or (absValue < 256 and string.char(absValue) or "?"))
screen.drawText(displayWidget.x + 1, y, 0xFFFFFF, char)
screen.drawText(displayWidget.x + 2, y, 0x696969, "\"")
end