mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
Fixed index out of bounds in term.isWide, closes #484.
This commit is contained in:
parent
df9438db8e
commit
a2e2a9b72e
@ -81,6 +81,13 @@ function term.setCursorBlink(enabled)
|
||||
end
|
||||
|
||||
function term.isWide(x, y)
|
||||
if not term.isAvailable() then
|
||||
return false
|
||||
end
|
||||
local w, h = component.gpu.getResolution()
|
||||
if x < 1 or x > w or y < 1 or y > h then
|
||||
return false
|
||||
end
|
||||
local char = component.gpu.get(x, y)
|
||||
if unicode.isWide(char) then
|
||||
-- The char at the specified position is a wide char.
|
||||
|
Loading…
x
Reference in New Issue
Block a user