small fix for canvas plugin
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ ascii.lua
|
|||||||
tests
|
tests
|
||||||
testWorkflows
|
testWorkflows
|
||||||
.vscode
|
.vscode
|
||||||
|
todo.txt
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ function Canvas:setCommand(index, drawFn)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Canvas:removeCommand(index)
|
function Canvas:removeCommand(index)
|
||||||
self.commands[index] = nil
|
--self.commands[self.type][index] = nil
|
||||||
|
table.remove(self.commands[self.type], index)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -56,8 +57,8 @@ function Canvas:text(x, y, text, fg, bg)
|
|||||||
local _text = self:getValue(text)
|
local _text = self:getValue(text)
|
||||||
local _fg = self:getValue(fg)
|
local _fg = self:getValue(fg)
|
||||||
local _bg = self:getValue(bg)
|
local _bg = self:getValue(bg)
|
||||||
local __fg = type(_fg) == "number" and tHex[_fg] or _fg
|
local __fg = type(_fg) == "number" and tHex[_fg]:rep(#text) or _fg
|
||||||
local __bg = type(_bg) == "number" and tHex[_bg] or _bg
|
local __bg = type(_bg) == "number" and tHex[_bg]:rep(#text) or _bg
|
||||||
render:drawText(_x, _y, _text)
|
render:drawText(_x, _y, _text)
|
||||||
if __fg then render:drawFg(_x, _y, __fg) end
|
if __fg then render:drawFg(_x, _y, __fg) end
|
||||||
if __bg then render:drawBg(_x, _y, __bg) end
|
if __bg then render:drawBg(_x, _y, __bg) end
|
||||||
|
|||||||
Reference in New Issue
Block a user