Fixed an issue with the SetFontOutline

This commit is contained in:
Tercio Jose
2024-03-13 18:32:53 -03:00
parent bba91eba78
commit 613a7d42d9
+21 -21
View File
@@ -1,6 +1,6 @@
local dversion = 522
local dversion = 523
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)
@@ -1450,7 +1450,7 @@ local ValidOutlines = {
}
DF.FontOutlineFlags = {
{"NONE", "None"},
{"", "None"},
{"MONOCHROME", "Monochrome"},
{"OUTLINE", "Outline"},
{"THICKOUTLINE", "Thick Outline"},
@@ -1462,32 +1462,32 @@ DF.FontOutlineFlags = {
---@param fontString table
---@param outline outline
function DF:SetFontOutline(fontString, outline)
local font, fontSize = fontString:GetFont()
if (outline) then
if (type(outline) == "string") then
outline = outline:upper()
end
local font, fontSize = fontString:GetFont()
if (outline) then
if (type(outline) == "string") then
outline = outline:upper()
end
if (ValidOutlines[outline]) then
outline = outline
if (ValidOutlines[outline]) then
outline = outline
elseif (type(outline) == "boolean" and outline) then
outline = "OUTLINE"
elseif (type(outline) == "boolean" and outline) then
outline = "OUTLINE"
elseif (type(outline) == "boolean" and not outline) then
outline = "NONE"
elseif (type(outline) == "boolean" and not outline) then
outline = "" --"NONE"
elseif (outline == 1) then
outline = "OUTLINE"
elseif (outline == 1) then
outline = "OUTLINE"
elseif (outline == 2) then
outline = "THICKOUTLINE"
end
end
elseif (outline == 2) then
outline = "THICKOUTLINE"
end
end
outline = (not outline or outline == "NONE") and "NONE" or outline
outline = (not outline or outline == "NONE") and "" or outline
fontString:SetFont(font, fontSize, outline)
fontString:SetFont(font, fontSize, outline)
end
---remove spaces from the start and end of the string