Skip to content

Commit 47e4b01

Browse files
TimMenu/Layout/Sector: fixed sector boudnaries
1 parent 3e69af1 commit 47e4b01

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

TimMenu/Layout/Sector.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ function Sector.Begin(win, label)
138138
end
139139

140140
win.NextLine = function(self, spacing)
141-
-- Call original with extra vertical spacing for sectors
141+
-- Directly update cursor within sector boundaries without calling origNext
142142
local extra = 5 -- add 5px more between lines inside sector
143143
local baseSpacing = spacing or Globals.Defaults.WINDOW_CONTENT_PADDING
144-
sector_data.origNext(self, baseSpacing + extra)
145-
-- Crucially, reset cursorX to the sector's indented start position
144+
-- Update cursorY manually to avoid origNext resetting cursorX to window padding
145+
self.cursorY = self.cursorY + self.lineHeight + baseSpacing + extra
146+
-- Keep cursorX constrained to sector's indented start position
146147
self.cursorX = sector_data.startX + sector_data.padding
147148
-- track y position after line break relative to window origin
148149
sector_data.maxY = math.max(sector_data.maxY, self.cursorY + self.lineHeight)

0 commit comments

Comments
 (0)