Skip to content

Commit be4f982

Browse files
TimMenu/Layout/Sector: improved sector padding
1 parent a9d5d72 commit be4f982

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

TimMenu/Layout/Sector.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,8 @@ local function _enqueueBorderDraw(win, sector_data, depth, persistentWidth, pers
9090
end
9191

9292
local function _finalizeCursorAndLayout(win, sector_data, width, height, pad)
93-
-- Add 50% more vertical spacing between sectors
94-
local sectorSpacing = math.ceil(Globals.Defaults.ITEM_SPACING * 1.5)
95-
9693
win.cursorX = sector_data.startX + width + pad
97-
win.cursorY = sector_data.startY + height + sectorSpacing
94+
win.cursorY = sector_data.startY
9895
win.lineHeight = math.max(win.lineHeight or 0, height)
9996

10097
if #win._sectorStack > 0 then
@@ -114,9 +111,10 @@ function Sector.Begin(win, label)
114111
-- persistent storage for sector sizes
115112
win._sectorSizes = win._sectorSizes or {}
116113

117-
-- capture current cursor as sector origin
118-
local startX, startY = win.cursorX, win.cursorY
114+
-- Increase padding inside sectors by 5 pixels vertically for better spacing
119115
local pad = Globals.Defaults.WINDOW_CONTENT_PADDING
116+
-- capture current cursor as sector origin (shifted down by pad)
117+
local startX, startY = win.cursorX, win.cursorY + pad
120118

121119
-- restore previous max extents if available
122120
local stored = win._sectorSizes[label]
@@ -142,8 +140,10 @@ function Sector.Begin(win, label)
142140
end
143141

144142
win.NextLine = function(self, spacing)
145-
-- Call original to handle vertical advance and line height
146-
sector_data.origNext(self, spacing)
143+
-- Call original with extra vertical spacing for sectors
144+
local extra = 5 -- add 5px more between lines inside sector
145+
local baseSpacing = spacing or Globals.Defaults.WINDOW_CONTENT_PADDING
146+
sector_data.origNext(self, baseSpacing + extra)
147147
-- Crucially, reset cursorX to the sector's indented start position
148148
self.cursorX = sector_data.startX + sector_data.padding
149149
-- track y position after line break relative to window origin

0 commit comments

Comments
 (0)