make font size limiting for SetFont
This commit is contained in:
@@ -77,10 +77,11 @@ local function modify(parent, region, data)
|
|||||||
region.useAuto = WeakAuras.CanHaveAuto(data);
|
region.useAuto = WeakAuras.CanHaveAuto(data);
|
||||||
|
|
||||||
local fontPath = SharedMedia:Fetch("font", data.font);
|
local fontPath = SharedMedia:Fetch("font", data.font);
|
||||||
text:SetFont(fontPath, data.fontSize, data.outline);
|
text:SetFont(fontPath, data.fontSize < 33 and data.fontSize or 33, data.outline);
|
||||||
if not text:GetFont() then -- Font invalid, set the font but keep the setting
|
if not text:GetFont() then -- Font invalid, set the font but keep the setting
|
||||||
text:SetFont(STANDARD_TEXT_FONT, data.fontSize, data.outline);
|
text:SetFont(STANDARD_TEXT_FONT, data.fontSize <= 33 and data.fontSize or 33, data.outline);
|
||||||
end
|
end
|
||||||
|
text:SetTextHeight(data.fontSize);
|
||||||
if text:GetFont() then
|
if text:GetFont() then
|
||||||
text:SetText("")
|
text:SetText("")
|
||||||
text:SetText(WeakAuras.ReplaceRaidMarkerSymbols(data.displayText));
|
text:SetText(WeakAuras.ReplaceRaidMarkerSymbols(data.displayText));
|
||||||
@@ -96,7 +97,6 @@ local function modify(parent, region, data)
|
|||||||
region:SetWidth(region.width);
|
region:SetWidth(region.width);
|
||||||
region:SetHeight(region.height);
|
region:SetHeight(region.height);
|
||||||
|
|
||||||
text:SetTextHeight(data.fontSize);
|
|
||||||
text:SetShadowColor(unpack(data.shadowColor))
|
text:SetShadowColor(unpack(data.shadowColor))
|
||||||
text:SetShadowOffset(data.shadowXOffset, data.shadowYOffset)
|
text:SetShadowOffset(data.shadowXOffset, data.shadowYOffset)
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ local function modify(parent, region, data)
|
|||||||
|
|
||||||
function region:SetTextHeight(size)
|
function region:SetTextHeight(size)
|
||||||
local fontPath = SharedMedia:Fetch("font", data.font);
|
local fontPath = SharedMedia:Fetch("font", data.font);
|
||||||
region.text:SetFont(fontPath, size, data.outline);
|
region.text:SetFont(fontPath, size < 33 and size or 33, data.outline);
|
||||||
region.text:SetTextHeight(size)
|
region.text:SetTextHeight(size)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -261,7 +261,8 @@ local function fallbackmodify(parent, region, data)
|
|||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
WeakAuras.regionPrototype.modify(parent, region, data);
|
||||||
local text = region.text;
|
local text = region.text;
|
||||||
|
|
||||||
text:SetFont(STANDARD_TEXT_FONT, data.fontSize, data.outline and "OUTLINE" or nil);
|
text:SetFont(STANDARD_TEXT_FONT, data.fontSize < 33 and data.fontSize or 33, data.outline and "OUTLINE" or nil);
|
||||||
|
text:SetTextHeight(data.fontSize);
|
||||||
if text:GetFont() then
|
if text:GetFont() then
|
||||||
text:SetText(WeakAuras.L["Region type %s not supported"]:format(data.regionType));
|
text:SetText(WeakAuras.L["Region type %s not supported"]:format(data.regionType));
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -210,16 +210,15 @@ local function modify(parent, region, parentData, data, first)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local fontPath = SharedMedia:Fetch("font", data.text_font);
|
local fontPath = SharedMedia:Fetch("font", data.text_font);
|
||||||
text:SetFont(fontPath, data.text_fontSize, data.text_fontType);
|
text:SetFont(fontPath, data.text_fontSize < 33 and data.text_fontSize or 33, data.text_fontType);
|
||||||
if not text:GetFont() then -- Font invalid, set the font but keep the setting
|
if not text:GetFont() then -- Font invalid, set the font but keep the setting
|
||||||
text:SetFont(STANDARD_TEXT_FONT, data.text_fontSize, data.text_fontType);
|
text:SetFont(STANDARD_TEXT_FONT, data.text_fontSize < 33 and data.text_fontSize or 33, data.text_fontType);
|
||||||
end
|
end
|
||||||
|
text:SetTextHeight(data.text_fontSize);
|
||||||
if text:GetFont() then
|
if text:GetFont() then
|
||||||
text:SetText(WeakAuras.ReplaceRaidMarkerSymbols(data.text_text));
|
text:SetText(WeakAuras.ReplaceRaidMarkerSymbols(data.text_text));
|
||||||
end
|
end
|
||||||
|
|
||||||
text:SetTextHeight(data.text_fontSize);
|
|
||||||
|
|
||||||
text:SetShadowColor(unpack(data.text_shadowColor))
|
text:SetShadowColor(unpack(data.text_shadowColor))
|
||||||
text:SetShadowOffset(data.text_shadowXOffset, data.text_shadowYOffset)
|
text:SetShadowOffset(data.text_shadowXOffset, data.text_shadowYOffset)
|
||||||
text:SetJustifyH(data.text_justify or "CENTER")
|
text:SetJustifyH(data.text_justify or "CENTER")
|
||||||
@@ -358,7 +357,7 @@ local function modify(parent, region, parentData, data, first)
|
|||||||
|
|
||||||
function region:SetTextHeight(size)
|
function region:SetTextHeight(size)
|
||||||
local fontPath = SharedMedia:Fetch("font", data.text_font);
|
local fontPath = SharedMedia:Fetch("font", data.text_font);
|
||||||
region.text:SetFont(fontPath, size, data.text_fontType);
|
region.text:SetFont(fontPath, size < 33 and size or 33, data.text_fontType);
|
||||||
region.text:SetTextHeight(size)
|
region.text:SetTextHeight(size)
|
||||||
region:UpdateAnchorOnTextChange();
|
region:UpdateAnchorOnTextChange();
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ local function modifyThumbnail(parent, borderframe, data, fullModify, size)
|
|||||||
size = size or 28;
|
size = size or 28;
|
||||||
|
|
||||||
local fontPath = SharedMedia:Fetch("font", data.font) or data.font;
|
local fontPath = SharedMedia:Fetch("font", data.font) or data.font;
|
||||||
text:SetFont(fontPath, data.fontSize, data.outline and "OUTLINE" or nil);
|
text:SetFont(fontPath, data.fontSize < 33 and data.fontSize or 33, data.outline and "OUTLINE" or nil);
|
||||||
text:SetTextHeight(data.fontSize);
|
text:SetTextHeight(data.fontSize);
|
||||||
text:SetText(data.displayText);
|
text:SetText(data.displayText);
|
||||||
text:SetTextColor(data.color[1], data.color[2], data.color[3], data.color[4]);
|
text:SetTextColor(data.color[1], data.color[2], data.color[3], data.color[4]);
|
||||||
|
|||||||
Reference in New Issue
Block a user