From a87f888b6e45dd2ccb68ac0ebb062dbe288e3d06 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Mon, 18 May 2026 16:20:53 +1000 Subject: [PATCH 1/2] Partial draw controls instead of completely omitting Config options were not being drawn if the scroll bar cause them to be partially cut off --- src/Classes/CompareTab.lua | 34 ++++++++++++++++++++++++++++++++-- src/Classes/ControlHost.lua | 12 +++++++++++- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/Classes/CompareTab.lua b/src/Classes/CompareTab.lua index eca72619032..b34e6204cbf 100644 --- a/src/Classes/CompareTab.lua +++ b/src/Classes/CompareTab.lua @@ -1847,6 +1847,16 @@ function CompareTabClass:Draw(viewPort, inputEvents) end self:DrawControls(viewPort) + if self.compareViewMode == "CONFIG" and compareEntry then + self:DrawConfig(contentVP, compareEntry, true) + self:DrawControlList(viewPort, { + self.controls.copyConfigBtn, + self.controls.configToggleBtn, + self.controls.configSearchEdit, + self.controls.configPrimarySetLabel, + self.controls.configPrimarySetSelect, + }) + end if drawingTree then SetDrawLayer(0) end @@ -1859,6 +1869,17 @@ end -- DRAW HELPERS -- ============================================================ +function CompareTabClass:DrawControlList(viewPort, controls) + local noTooltip = function(control) + return self.selControl and self.selControl.hasFocus and self.selControl ~= control + end + for _, control in ipairs(controls) do + if control:IsShown() and control.Draw then + control:Draw(viewPort, noTooltip(control)) + end + end +end + -- Pre-draw tree header/footer backgrounds and position tree controls. -- Must run before ProcessControlsInput so controls render on top of backgrounds. function CompareTabClass:LayoutTreeView(contentVP, compareEntry) @@ -2176,6 +2197,7 @@ function CompareTabClass:LayoutConfigView(contentVP, compareEntry) local scrollTopAbs = contentVP.y + fixedHeaderHeight local scrollBottomAbs = contentVP.y + contentVP.height local ctrlH = rowHeight + local mouseClipRect = { contentVP.x, scrollTopAbs, contentVP.width, scrollBottomAbs - scrollTopAbs } for _, sec in ipairs(sectionLayout) do local sectionAbsX = contentVP.x + sec.x local rowY = sec.y + sectionInnerPad @@ -2187,11 +2209,13 @@ function CompareTabClass:LayoutConfigView(contentVP, compareEntry) ci.compareControl.y = contentVP.y + fixedHeaderHeight + rowY - self.scrollY local shownFn = function() local ay = ci.primaryControl.y - return ay >= scrollTopAbs and ay + ctrlH <= scrollBottomAbs + return ay + ctrlH > scrollTopAbs and ay < scrollBottomAbs and self.compareViewMode == "CONFIG" and self:GetActiveCompare() ~= nil end ci.primaryControl.shown = shownFn ci.compareControl.shown = shownFn + ci.primaryControl.mouseClipRect = mouseClipRect + ci.compareControl.mouseClipRect = mouseClipRect rowY = rowY + rowHeight end end @@ -4909,7 +4933,7 @@ end -- ============================================================ -- CONFIG VIEW -- ============================================================ -function CompareTabClass:DrawConfig(vp, compareEntry) +function CompareTabClass:DrawConfig(vp, compareEntry, headerOnly) local rowHeight = LAYOUT.configRowHeight local columnHeaderHeight = LAYOUT.configColumnHeaderHeight local fixedHeaderHeight = LAYOUT.configFixedHeaderHeight @@ -4919,6 +4943,8 @@ function CompareTabClass:DrawConfig(vp, compareEntry) -- Fixed header area: row 1 = buttons, row 2 = search/dropdowns, then column headers + separator SetViewport(vp.x, vp.y, vp.width, fixedHeaderHeight) + SetDrawColor(0.05, 0.05, 0.05) + DrawImage(nil, 0, 0, vp.width, fixedHeaderHeight) -- Controls are drawn by ControlHost (positioned in LayoutConfigView) local colHeaderY = 54 SetDrawColor(1, 1, 1) @@ -4930,6 +4956,10 @@ function CompareTabClass:DrawConfig(vp, compareEntry) colorCodes.WARNING .. (compareEntry.label or "Compare Build")) SetDrawColor(0.5, 0.5, 0.5) DrawImage(nil, 4, colHeaderY + columnHeaderHeight + 4, vp.width - 8, 2) + if headerOnly then + SetViewport() + return + end -- Scrollable content area (clipped below fixed header) local scrollH = vp.height - fixedHeaderHeight diff --git a/src/Classes/ControlHost.lua b/src/Classes/ControlHost.lua index 4f795135b82..1c0b07ebac1 100644 --- a/src/Classes/ControlHost.lua +++ b/src/Classes/ControlHost.lua @@ -31,7 +31,17 @@ end function ControlHostClass:GetMouseOverControl() for _, control in pairs(self.controls) do if control.IsMouseOver and control:IsMouseOver() then - return control + local clip = control.mouseClipRect + if type(clip) == "function" then + clip = clip(control) + end + if not clip then + return control + end + local cursorX, cursorY = GetCursorPos() + if cursorX >= clip[1] and cursorY >= clip[2] and cursorX < clip[1] + clip[3] and cursorY < clip[2] + clip[4] then + return control + end end end end From ec0be58fd0206bb1814cac0db0b5d3a0f2d5f8d3 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Mon, 18 May 2026 16:25:54 +1000 Subject: [PATCH 2/2] Stop trade popup from showing item tooltips in background --- src/Classes/CompareTab.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Classes/CompareTab.lua b/src/Classes/CompareTab.lua index b34e6204cbf..cec729145ed 100644 --- a/src/Classes/CompareTab.lua +++ b/src/Classes/CompareTab.lua @@ -3983,7 +3983,7 @@ function CompareTabClass:DrawItems(vp, compareEntry, inputEvents) -- Draw item tooltip on hover (compact mode only, on top of everything) SetViewport() local maxTooltipWidth = m_min(600, m_max(260, vp.width - 24)) - if hoverItem and hoverItemsTab then + if not main.popups[1] and hoverItem and hoverItemsTab then self.itemTooltip:Clear() hoverItemsTab:AddItemTooltip(self.itemTooltip, hoverItem, nil, nil, maxTooltipWidth) SetDrawLayer(nil, 100) @@ -3992,7 +3992,7 @@ function CompareTabClass:DrawItems(vp, compareEntry, inputEvents) end -- Draw stat comparison tooltip when hovering Equip button - if hoverEquipItem and hoverEquipSlotName and not hoverItem then + if not main.popups[1] and hoverEquipItem and hoverEquipSlotName and not hoverItem then self.itemTooltip:Clear() self.itemTooltip.maxWidth = maxTooltipWidth local calcFunc, calcBase = self.calcs.getMiscCalculator(self.primaryBuild)