small bugfix

This commit is contained in:
Robert Jelic
2022-07-08 21:06:12 +02:00
parent b78bf92cca
commit c6d7929741
2 changed files with 7 additions and 8 deletions

View File

@@ -64,8 +64,10 @@ local bInstance = {
}
local function drawFrames()
mainFrame:draw()
mainFrame:drawUpdate()
if(mainFrame~=nil)then
mainFrame:draw()
mainFrame:drawUpdate()
end
for _,v in pairs(monFrames)do
v:draw()
v:drawUpdate()

View File

@@ -86,9 +86,10 @@ return function(name)
local splittedText = utils.splitString(self:getValue(), " ")
local text = {}
local line = ""
for _,v in pairs(splittedText)do
for k,v in pairs(splittedText)do
if(line:len()+v:len()<=self.width)then
line = line=="" and v or line.." "..v
if(k==#splittedText)then table.insert(text, line) end
else
table.insert(text, line)
line = v:sub(1,self.width)
@@ -98,11 +99,7 @@ return function(name)
self.parent:setText(obx, oby+k-1, v)
end
else
for n = 1, self.height do
if (n == verticalAlign) then
self.parent:setText(obx, oby + (n - 1), utils.getTextHorizontalAlign(self:getValue(), self.width, textHorizontalAlign))
end
end
self.parent:setText(obx, oby, utils.getTextHorizontalAlign(self:getValue(), self.width, textHorizontalAlign))
end
else
local tData = bigFont(fontsize, self:getValue(), self.fgColor, self.bgColor or colors.black)