Update Label.lua

Small fix when calculating the size for labels
This commit is contained in:
Robert Jelic
2023-06-17 18:02:50 +02:00
committed by GitHub
parent cbe67c3919
commit 958b962ada

View File

@@ -14,11 +14,12 @@ return function(name, basalt)
local autoSize = self:getAutoSize()
if(autoSize)then
local t = wrapText(value, #value)
local newW, newH = 1,1
local newW, newH = 1,0
for _,v in pairs(t)do
newH = newH+1
newH = newH + 1
newW = math.max(newW, v:len())
end
if(newH==0)then newH = 1 end
self:setSize(newW, newH)
self:setAutoSize(true)
end
@@ -64,4 +65,4 @@ return function(name, basalt)
object.__index = object
return setmetatable(object, base)
end
end