Skip to content

Commit

Permalink
Improve last line padding
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Anonomit committed Dec 27, 2023
1 parent 2ab401a commit 55d3f11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Operations/CalculatePadding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Operations/ScanTooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 55d3f11

Please sign in to comment.