SetOffset() also turns off end-tracking in Table. Fixes #238

This commit is contained in:
Oliver 2019-03-08 20:13:09 +01:00
parent c16128c927
commit 03d744dee3
2 changed files with 2 additions and 3 deletions

View File

@ -424,9 +424,7 @@ func (l *List) Draw(screen tcell.Screen) {
// Background color of selected text. // Background color of selected text.
if index == l.currentItem && (!l.selectedFocusOnly || l.HasFocus()) { if index == l.currentItem && (!l.selectedFocusOnly || l.HasFocus()) {
textWidth := width
// Width of background color of selected item.
var textWidth int = width
if !l.highlightFullLine { if !l.highlightFullLine {
if w := StringWidth(item.MainText); w < textWidth { if w := StringWidth(item.MainText); w < textWidth {
textWidth = w textWidth = w

View File

@ -368,6 +368,7 @@ func (t *Table) Select(row, column int) *Table {
// Fixed rows and columns are never skipped. // Fixed rows and columns are never skipped.
func (t *Table) SetOffset(row, column int) *Table { func (t *Table) SetOffset(row, column int) *Table {
t.rowOffset, t.columnOffset = row, column t.rowOffset, t.columnOffset = row, column
t.trackEnd = false
return t return t
} }