7d93a2790c60475f7fb381050fde6131959078fd — Elias Naur 4 months ago 1529f20
ui/layout: delete List.Distance field

Distance was meant to be used for implementing nested scrollers, but
I don't think the API is right. For example, Distance doesn't report
residual fling scrolling.

Delete the field while we wait for a better approach.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 0 insertions(+), 6 deletions(-)

M ui/layout/list.go
M ui/layout/list.go => ui/layout/list.go +0 -6
@@ 28,10 28,6 @@ type List struct {
 	// Alignment is the cross axis alignment of list elements.
 	Alignment Alignment
 
-	// Distance is the difference in scroll position
-	// since the last call to Init.
-	Distance int
-
 	// beforeEnd tracks whether the List position is before
 	// the very end.
 	beforeEnd bool


@@ 106,10 102,8 @@ func (l *List) Dragging() bool {
 }
 
 func (l *List) update() {
-	l.Distance = 0
 	d := l.scroll.Scroll(l.config, l.queue, gesture.Axis(l.Axis))
 	l.scrollDelta = d
-	l.Distance += d
 	l.offset += d
 }