Skip to content

Commit a22210c

Browse files
committed
handle overlapping build names in summary tab
1 parent 969a653 commit a22210c

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

src/Classes/CompareTab.lua

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2813,21 +2813,29 @@ function CompareTabClass:DrawSummary(vp, compareEntry)
28132813
local lineHeight = 18
28142814
local headerHeight = 22
28152815

2816-
-- Column positions
2816+
-- Column positions (col3R and col4 shift right dynamically to avoid name overlap)
28172817
local col1 = LAYOUT.summaryCol1
28182818
local col2R = LAYOUT.summaryCol2Right
2819-
local col3R = LAYOUT.summaryCol3Right
2820-
local col4 = LAYOUT.summaryCol4
2819+
2820+
local primaryName = self:GetShortBuildName(self.primaryBuild.buildName)
2821+
local compareName = compareEntry.label or "Compare Build"
2822+
local primaryNameW = DrawStringWidth(headerHeight, "VAR", primaryName)
2823+
local compareNameW = DrawStringWidth(headerHeight, "VAR", compareName)
2824+
2825+
local minCol3R = col2R + compareNameW + 16
2826+
local maxCol3R = vp.width - 200
2827+
local col3R = m_min(m_max(LAYOUT.summaryCol3Right, minCol3R), maxCol3R)
2828+
local col4 = col3R + 20
28212829

28222830
SetViewport(vp.x, vp.y, vp.width, vp.height)
28232831
local drawY = 4 - self.scrollY
28242832

28252833
-- Headers
28262834
SetDrawColor(1, 1, 1)
28272835
DrawString(col1, drawY, "LEFT", headerHeight, "VAR", "^7Stat")
2828-
DrawString(col2R, drawY, "RIGHT_X", headerHeight, "VAR", colorCodes.POSITIVE .. self:GetShortBuildName(self.primaryBuild.buildName))
2836+
DrawString(col2R, drawY, "RIGHT_X", headerHeight, "VAR", colorCodes.POSITIVE .. primaryName)
28292837
DrawString(col3R, drawY, "RIGHT_X", headerHeight, "VAR",
2830-
colorCodes.WARNING .. (compareEntry.label or "Compare Build"))
2838+
colorCodes.WARNING .. compareName)
28312839
DrawString(col4, drawY, "LEFT", headerHeight, "VAR", "^7Difference")
28322840
drawY = drawY + headerHeight + 4
28332841

0 commit comments

Comments
 (0)