Skip to content

Commit

Permalink
Fixed an issue with the SetFontOutline
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Mar 13, 2024
1 parent bba91eb commit 613a7d4
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 522
local dversion = 523
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down Expand Up @@ -1450,7 +1450,7 @@ local ValidOutlines = {
}

DF.FontOutlineFlags = {
{"NONE", "None"},
{"", "None"},
{"MONOCHROME", "Monochrome"},
{"OUTLINE", "Outline"},
{"THICKOUTLINE", "Thick Outline"},
Expand All @@ -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
Expand Down

0 comments on commit 613a7d4

Please sign in to comment.