From 581634d19965eb3935bf428d87928516d801bfa3 Mon Sep 17 00:00:00 2001 From: Azik <36937698+disarrayed@users.noreply.github.com> Date: Mon, 1 Jun 2026 20:29:46 -0500 Subject: [PATCH] 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) --- Modules/Tracker/QuestieTracker.lua | 32 +++++++++++++++++++++-------- Modules/Tracker/TrackerLinePool.lua | 9 +++++++- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Modules/Tracker/QuestieTracker.lua b/Modules/Tracker/QuestieTracker.lua index 0fda801..be3cc90 100644 --- a/Modules/Tracker/QuestieTracker.lua +++ b/Modules/Tracker/QuestieTracker.lua @@ -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 diff --git a/Modules/Tracker/TrackerLinePool.lua b/Modules/Tracker/TrackerLinePool.lua index 4deb0d9..afcb596 100644 --- a/Modules/Tracker/TrackerLinePool.lua +++ b/Modules/Tracker/TrackerLinePool.lua @@ -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