Update Label.lua
Small fix when calculating the size for labels
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user