Use unicode sub for gpu.fill, fixes #7

This commit is contained in:
Łukasz Magiera 2016-03-07 15:32:00 +01:00
parent 92354e8a08
commit 4a3242eb3e
2 changed files with 5 additions and 2 deletions

View File

@ -147,7 +147,7 @@ function fbgpu.start()
checkArg(3, w, "number")
checkArg(4, h, "number")
checkArg(5, ch, "string")
ch = ch:sub(1, 1)
ch = usub(ch, 1, 1)
fb.fill(x-1, y-1, x+w-2, y+h-2, background, foreground, utf8.codepoint(ch))
return true
end

View File

@ -22,7 +22,10 @@ end
local background = 0
local foreground = 0
local usub
function wingpu.start()
usub = modules.sandbox.unicode.sub
local gpu = {}
function gpu.bind() return false, "This is static bound gpu" end
@ -135,7 +138,7 @@ function wingpu.start()
checkArg(3, w, "number")
checkArg(4, h, "number")
checkArg(5, ch, "string")
ch = ch:sub(1, 1)
ch = usub(ch, 1, 1)
win.fill(x-1, y-1, x+w-2, y+h-2, background, foreground, utf8.codepoint(ch))
return true
end