From 7d93a2790c60475f7fb381050fde6131959078fd Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 5 Sep 2019 20:41:09 +0200 Subject: [PATCH] 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 --- ui/layout/list.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ui/layout/list.go b/ui/layout/list.go index 885f4e31..57d2aa80 100644 --- a/ui/layout/list.go +++ b/ui/layout/list.go @@ -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 }