mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 03:05:30 -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
|
end
|
||||||
|
|
||||||
function term.isWide(x, y)
|
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)
|
local char = component.gpu.get(x, y)
|
||||||
if unicode.isWide(char) then
|
if unicode.isWide(char) then
|
||||||
-- The char at the specified position is a wide char.
|
-- The char at the specified position is a wide char.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user