commit 4cb5734
Hubert Hirtz
·
2021-10-26 15:27:43 +0000 UTC
parent 2f253f6
timeline drawing: fix off-by-one error
1 files changed,
+2,
-6
+2,
-6
1@@ -490,11 +490,7 @@ func (bs *BufferList) DrawHorizontalBufferList(screen tcell.Screen, x0, y0, widt
2 }
3
4 func (bs *BufferList) DrawTimeline(screen tcell.Screen, x0, y0, nickColWidth int) {
5- for x := x0; x < x0+bs.tlInnerWidth+nickColWidth+9; x++ {
6- for y := y0; y < y0+bs.tlHeight; y++ {
7- screen.SetContent(x, y, ' ', nil, tcell.StyleDefault)
8- }
9- }
10+ clearArea(screen, x0, y0, bs.tlInnerWidth+nickColWidth+9, bs.tlHeight)
11
12 b := &bs.list[bs.current]
13 yi := b.scrollAmt + y0 + bs.tlHeight
14@@ -536,7 +532,7 @@ func (bs *BufferList) DrawTimeline(screen tcell.Screen, x0, y0, nickColWidth int
15 x = x1
16 y++
17 nls = nls[1:]
18- if bs.tlHeight < y {
19+ if bs.tlHeight <= y {
20 break
21 }
22 }