1
0
mirror of https://github.com/LDDestroier/CC/ synced 2024-11-13 21:34:54 +00:00

Fixed newBuffer when making smaller buffer from larger one

This commit is contained in:
LDDestroier 2020-02-23 18:45:00 -05:00 committed by GitHub
parent 9698ad50f2
commit 7aa8bd6551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -403,15 +403,16 @@ windont.newWindow = function( x, y, width, height, misc )
-- make a new buffer (optionally uses an existing buffer as a reference)
newBuffer = function(width, height, char, text, back, drawAtop)
local output = drawAtop or {{}, {}, {}}
local output = {{}, {}, {}}
drawAtop = drawAtop or {{}, {}, {}}
for y = 1, height do
output[1][y] = output[1][y] or {}
output[2][y] = output[2][y] or {}
output[3][y] = output[3][y] or {}
for x = 1, width do
output[1][y][x] = output[1][y][x] or (char or " ")
output[2][y][x] = output[2][y][x] or (text or "0")
output[3][y][x] = output[3][y][x] or (back or "f")
output[1][y][x] = (drawAtop[1][y] or {})[x] or (output[1][y][x] or (char or " "))
output[2][y][x] = (drawAtop[2][y] or {})[x] or (output[2][y][x] or (text or "0"))
output[3][y][x] = (drawAtop[3][y] or {})[x] or (output[3][y][x] or (back or "f"))
end
end
return output