Fix Ascension tracker line wrapping

Use tracker wrapping helpers that fall back when Ascension font strings do not expose GetNumLines or GetWrappedWidth.

(cherry picked from commit c9b7de2a636ca918c2549a13de87a688861c831f)
This commit is contained in:
Azik
2026-06-01 20:29:46 -05:00
committed by Xurkon
parent 31864a467e
commit 581634d199
2 changed files with 31 additions and 10 deletions
+23 -9
View File
@@ -47,6 +47,20 @@ local C_Timer = QuestieCompat.C_Timer
local GetQuestLogTitle = QuestieCompat.GetQuestLogTitle
local GetQuestLogIndexByID = QuestieCompat.GetQuestLogIndexByID
local GetItemInfo = QuestieCompat.GetItemInfo
local function GetNumLines(label)
if label.GetNumLines then
return label:GetNumLines()
end
return QuestieCompat.GetNumLines(label)
end
local function GetWrappedWidth(label)
if label.GetWrappedWidth then
return label:GetWrappedWidth()
end
return label:GetWidth()
end
local LSM30 = LibStub and LibStub("LibSharedMedia-3.0", true)
@@ -1383,16 +1397,16 @@ function QuestieTracker:Update()
-- Set Blizzard Completion Label and Line widths
line.label:SetWidth(trackerBaseFrame:GetWidth() - objectiveMarginLeft -
trackerMarginRight)
line:SetWidth(line.label:GetWrappedWidth() + objectiveMarginLeft)
line:SetWidth(GetWrappedWidth(line.label) + objectiveMarginLeft)
-- Blizzard Completion Text tends to be rather verbose. Allow text wrapping.
line.label:SetHeight(line.label:GetStringHeight() *
line.label:GetNumLines())
GetNumLines(line.label))
line:SetHeight(line.label:GetHeight())
-- Compare trackerLineWidth, trackerMinLineWidth and the current label, then save the widest width
trackerLineWidth = math.max(trackerLineWidth, trackerMinLineWidth,
line.label:GetWrappedWidth() + objectiveMarginLeft)
GetWrappedWidth(line.label) + objectiveMarginLeft)
end
-- Update Quest has a check for this edge case. Should reset the Quest Icons and show the Quest Finisher
@@ -1459,15 +1473,15 @@ function QuestieTracker:Update()
-- Set Blizzard Completion Label and Line widths
line.label:SetWidth(trackerBaseFrame:GetWidth() - objectiveMarginLeft -
trackerMarginRight)
line:SetWidth(line.label:GetWrappedWidth() + objectiveMarginLeft)
line:SetWidth(GetWrappedWidth(line.label) + objectiveMarginLeft)
-- Blizzard Completion Text tends to be rather verbose. Allow text wrapping.
line.label:SetHeight(line.label:GetStringHeight() * line.label:GetNumLines())
line.label:SetHeight(line.label:GetStringHeight() * GetNumLines(line.label))
line:SetHeight(line.label:GetHeight())
-- Compare trackerLineWidth, trackerMinLineWidth and the current label, then save the widest width
trackerLineWidth = math.max(trackerLineWidth, trackerMinLineWidth,
line.label:GetWrappedWidth() + objectiveMarginLeft)
GetWrappedWidth(line.label) + objectiveMarginLeft)
end
-- Hide the Secondary Quest Item Button. There are some quests with usable items after a quest is completed I
@@ -1738,15 +1752,15 @@ function QuestieTracker:Update()
-- Set Label and Line widths
line.label:SetWidth(trackerBaseFrame:GetWidth() - objectiveMarginLeft -
trackerMarginRight)
line:SetWidth(line.label:GetWrappedWidth() + objectiveMarginLeft)
line:SetWidth(GetWrappedWidth(line.label) + objectiveMarginLeft)
-- TextWrap Objective and set height
line.label:SetHeight(line.label:GetStringHeight() * line.label:GetNumLines())
line.label:SetHeight(line.label:GetStringHeight() * GetNumLines(line.label))
line:SetHeight(line.label:GetHeight())
-- Compare trackerLineWidth, trackerMinLineWidth and the current label, then save the widest width
trackerLineWidth = math.max(trackerLineWidth, trackerMinLineWidth,
line.label:GetWrappedWidth() + objectiveMarginLeft)
GetWrappedWidth(line.label) + objectiveMarginLeft)
end
-- Set Objective state
+8 -1
View File
@@ -35,6 +35,13 @@ local l10n = QuestieLoader:ImportModule("l10n")
local C_Timer = QuestieCompat.C_Timer
local C_QuestLog = QuestieCompat.C_QuestLog
local GetQuestLogIndexByID = QuestieCompat.GetQuestLogIndexByID
local function GetNumLines(label)
if label.GetNumLines then
return label:GetNumLines()
end
return QuestieCompat.GetNumLines(label)
end
local LibDropDown = QuestieCompat.LibUIDropDownMenu or LibStub:GetLibrary("LibUIDropDownMenuQuestie-4.0")
local LSM30 = LibStub and LibStub("LibSharedMedia-3.0", true)
@@ -751,7 +758,7 @@ function TrackerLinePool.UpdateWrappedLineWidths(trackerLineWidth)
for _, line in pairs(linePool) do
if Questie.db.profile.TrackerWidth == 0 then
if line.mode == "objective" then
if line.label:GetNumLines() > 1 and line:GetHeight() > Questie.db.profile.trackerFontSizeObjective then
if GetNumLines(line.label) > 1 and line:GetHeight() > Questie.db.profile.trackerFontSizeObjective then
line.label:SetText(line.label:GetText())
if line.altButton then