some smaller changes

This commit is contained in:
Robert Jelic
2022-05-19 22:50:34 +02:00
parent ed1f32bbf9
commit 4f20ede76a
5 changed files with 26 additions and 25 deletions

View File

@@ -21,8 +21,8 @@ local function Label(name)
return self
end;
setSize = function(self, width, h)
self.width, self.height = width, h
setSize = function(self, width, height)
self.width, self.height = width, height
autoWidth = false
return self
end;
@@ -31,7 +31,9 @@ local function Label(name)
if (base.draw(self)) then
if (self.parent ~= nil) then
local obx, oby = self:getAnchorPosition()
self.parent:writeText(obx, oby, self:getValue(), self.bgColor, self.fgColor)
self.parent:setBackground(obx, oby, self.width, self.height, self.bgColor)
self.parent:setForeground(obx, oby, self.width, self.height, self.fgColor)
self.parent:writeText(obx, oby, self:getValue():sub(1, self.width), self.bgColor, self.fgColor)
end
end
end;