Use unicode sub for gpu.fill, fixes #7
This commit is contained in:
parent
92354e8a08
commit
4a3242eb3e
@ -147,7 +147,7 @@ function fbgpu.start()
|
|||||||
checkArg(3, w, "number")
|
checkArg(3, w, "number")
|
||||||
checkArg(4, h, "number")
|
checkArg(4, h, "number")
|
||||||
checkArg(5, ch, "string")
|
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))
|
fb.fill(x-1, y-1, x+w-2, y+h-2, background, foreground, utf8.codepoint(ch))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -22,7 +22,10 @@ end
|
|||||||
local background = 0
|
local background = 0
|
||||||
local foreground = 0
|
local foreground = 0
|
||||||
|
|
||||||
|
local usub
|
||||||
|
|
||||||
function wingpu.start()
|
function wingpu.start()
|
||||||
|
usub = modules.sandbox.unicode.sub
|
||||||
local gpu = {}
|
local gpu = {}
|
||||||
|
|
||||||
function gpu.bind() return false, "This is static bound gpu" end
|
function gpu.bind() return false, "This is static bound gpu" end
|
||||||
@ -135,7 +138,7 @@ function wingpu.start()
|
|||||||
checkArg(3, w, "number")
|
checkArg(3, w, "number")
|
||||||
checkArg(4, h, "number")
|
checkArg(4, h, "number")
|
||||||
checkArg(5, ch, "string")
|
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))
|
win.fill(x-1, y-1, x+w-2, y+h-2, background, foreground, utf8.codepoint(ch))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user