Internal variables for swapping

This commit is contained in:
Ollo 2021-03-20 16:07:05 +01:00
parent 070d5de729
commit 6a70803b6c

View File

@ -66,11 +66,12 @@ local swapLine = function(data, lineOffset)
if (data.rgbBuffer == nil) then if (data.rgbBuffer == nil) then
return false return false
end end
for i = 0,10 do for i = 0,10 do
local tmpColor=data.rgbBuffer:get(lineOffset+i) local num=tonumber(lineOffset)+i
data.rgbBuffer:set(lineOffset+i, data.rgbBuffer:get(lineOffset+10-i)) local num2=tonumber(lineOffset)+10-i
data.rgbBuffer:set(lineOffset+10-i, tmpColor) local tmpColor=data.rgbBuffer:get(num)
data.rgbBuffer:set(num, data.rgbBuffer:get(num2))
data.rgbBuffer:set(num2, tmpColor)
end end
return true return true
end end