Update bigfonts.lua

Fixed bigfonts size bug
This commit is contained in:
Robert Jelic
2023-05-04 20:34:36 +02:00
parent ba1f602965
commit 419cfad357

View File

@@ -171,8 +171,8 @@ return {
getSize = function(self) getSize = function(self)
local w, h = base.getSize(self) local w, h = base.getSize(self)
if(fontsize>1)then if(fontsize>1)and(self:getAutoSize())then
return w * (3*fontsize-3), h * (3*fontsize-3) return fontsize==2 and self:getText():len()*3 or math.floor(self:getText():len() * 8.5), fontsize==2 and h * 2 or math.floor(h)
else else
return w, h return w, h
end end
@@ -180,8 +180,8 @@ return {
getWidth = function(self) getWidth = function(self)
local w = base.getWidth(self) local w = base.getWidth(self)
if(fontsize>1)then if(fontsize>1)and(self:getAutoSize())then
return w * (3*fontsize-3) return fontsize==2 and self:getText():len()*3 or math.floor(self:getText():len() * 8.5)
else else
return w return w
end end
@@ -189,8 +189,8 @@ return {
getHeight = function(self) getHeight = function(self)
local h = base.getHeight(self) local h = base.getHeight(self)
if(fontsize>1)then if(fontsize>1)and(self:getAutoSize())then
return h * (3*fontsize-3) return fontsize==2 and h * 2 or math.floor(h)
else else
return h return h
end end