From 55d3f11ac3f3c1e29efc8612aeadd79ebac013cb Mon Sep 17 00:00:00 2001 From: Anonomit Date: Tue, 26 Dec 2023 19:44:12 -0500 Subject: [PATCH] Improve last line padding When it appears that no other addons are adding tooltip lines, ZeraTooltip will try harder to prevent there being an empty line at the bottom of the tooltip. --- Operations/CalculatePadding.lua | 2 +- Operations/ScanTooltip.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Operations/CalculatePadding.lua b/Operations/CalculatePadding.lua index 61ad13e..25f5cf0 100644 --- a/Operations/CalculatePadding.lua +++ b/Operations/CalculatePadding.lua @@ -151,7 +151,7 @@ function Addon:CalculatePadding(tooltipData) -- pad last line do local lastLine = tooltipData[#tooltipData] - if self:GetOption"padLastLine" then + if self:GetOption"padLastLine" and tooltipData.realNumLines > tooltipData.numLines then if lastLine.type == "Padding" then if lastLine.hide then lastLine.hide = nil diff --git a/Operations/ScanTooltip.lua b/Operations/ScanTooltip.lua index dff5690..d53401b 100644 --- a/Operations/ScanTooltip.lua +++ b/Operations/ScanTooltip.lua @@ -117,7 +117,8 @@ function Addon:ReadTooltip(tooltip, name, link, maxLines) realColor = self:GetTextColorAsHex(realTextLeft), } end - tooltipData.numLines = #tooltipData + tooltipData.numLines = #tooltipData + tooltipData.realNumLines = tooltip.tooltip:NumLines() -- tooltipData.name = name -- tooltipData.link = link