chore(textwidget): fail if position is wrong

This commit is contained in:
Kazhnuz 2021-08-28 14:30:26 +02:00
parent 44781ba325
commit 0ce811fa97

View file

@ -80,6 +80,8 @@ function TextWidget:drawCanvas()
w = self:getPadding() w = self:getPadding()
elseif (complexLabel.position == "right") then elseif (complexLabel.position == "right") then
w = math.floor(self.width - self:getPadding()) w = math.floor(self.width - self:getPadding())
else
error("Position " .. complexLabel.position .. " is unknown for label " .. complexLabel.label)
end end
font:draw(complexLabel.label, w, h, -1, complexLabel.position) font:draw(complexLabel.label, w, h, -1, complexLabel.position)
end end