239 - Lua error with ElvUI 3
----- What steps will reproduce the problem?
When casting a spell (like divine hymn), got the following error. Not happened on other spells.
----- What version of the product are you using?
InlineAura from Github
Elvui 3.15
----- Do you have an error log of what happened?
1x InlineAura-@project-version@\Display.lua:201 ERROR: <unnamed>:SetFont(): invalid fontHeight: 6.7467546216449e-008, height must be > 0
InlineAura-@project-version@\Display.lua:201 in function `UpdateFont'
InlineAura-@project-version@\Display.lua:232 in function `OnUpdate'
InlineAura-@project-version@\Display.lua:220 in function <InlineAura\Display.lua:213
(tail call): ?:
InlineAura-@project-version@\Display.lua:376 in function `ShowCountdownAndStack'
InlineAura-@project-version@\Core.lua:670 in function <InlineAura\Core.lua:617
InlineAura-@project-version@\Core.lua:871 in function <InlineAura\Core.lua:858
InlineAura-@project-version@\Core.lua:896 in function `OnUpdate'
InlineAura-@project-version@\Core.lua:1355 in function <InlineAura\Core.lua:1352
----- Please provide any additional information below.
For some reason, somtimes the variable overflowRatio is equal to 7000+ so the division with fontSize is very small (something like 1e-04) and cause error.
I fix error with the following code waiting you can have a look :
function countdownProto:UpdateFont()
local fontSize, r, g, b = self:getFontSize()
self:SetTextColor(r, g, b)
self:SetFont(self.font fontSize, self.fontFlag
local overflowRatio = self:GetStringWidth() / (self:GetParent():GetWidth()-4)
if overflowRatio > 1 then
if fontSize / overflowRatio > 1 then
return self:SetFont(self.font fontSize / overflowRatio, self.fontFlag
end
end
end
| User | When | Change |
|---|---|---|
| Kilay44 | Jan 19, 2012 at 20:32 UTC | Create |