diff options
| author | citrons <citrons@mondecitronne.com> | 2025-06-01 19:10:35 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-06-01 19:10:35 -0500 |
| commit | 335f57fbc8403b32b5e3d8ea1cb1b713cdacb5fc (patch) | |
| tree | 12a5adeededdbcf4ebdea209081bfd671c119e69 /tui/layout.go | |
| parent | f50a839609847169702d76560dcdc7481099d7bc (diff) | |
message history
Diffstat (limited to 'tui/layout.go')
| -rw-r--r-- | tui/layout.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tui/layout.go b/tui/layout.go index 5811f4e..480f3cc 100644 --- a/tui/layout.go +++ b/tui/layout.go @@ -285,9 +285,10 @@ func (b *Box) computePositions(axis int) { if last != nil { lastPos := last.computedPosition - lastPos += last.computedSize[axis] if b.Dir.reverse() { lastPos = b.computedSize[axis] - lastPos + } else { + lastPos += last.computedSize[axis] } b.Scroll.absolute = min(b.Scroll.absolute, lastPos - b.computedSize[axis]) } @@ -300,7 +301,7 @@ func (b *Box) computePositions(axis int) { } else { c.computedPosition += b.Scroll.absolute } - if c.computedPosition > b.computedRect.min[axis] && + if c.computedPosition >= b.computedRect.min[axis] && c.computedPosition < b.computedRect.max[axis] { if firstShown == nil { firstShown = c @@ -308,12 +309,9 @@ func (b *Box) computePositions(axis int) { lastShown = c } } - if firstShown == first { - b.Scroll.atFirst = true - } - if lastShown == last { - b.Scroll.atLast = true - } + b.Scroll.atFirst = firstShown == first + b.Scroll.atLast = lastShown == last + if firstShown != nil { p := first.computedPosition if b.Dir.reverse() { |
