ui/layout: unexport List.Update and move its parameters to state

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-06-21 16:00:24 +02:00
parent d4eb86a9b5
commit 898c3c5d7d
+5 -2
View File
@@ -18,6 +18,8 @@ type scrollChild struct {
} }
type List struct { type List struct {
Config *ui.Config
Inputs input.Events
Axis Axis Axis Axis
Invert bool Invert bool
CrossAxisAlignment CrossAxisAlignment CrossAxisAlignment CrossAxisAlignment
@@ -49,6 +51,7 @@ const (
) )
func (l *List) Init(ops *ui.Ops, cs Constraints, len int) { func (l *List) Init(ops *ui.Ops, cs Constraints, len int) {
l.update()
l.ops = ops l.ops = ops
l.dir = iterateNone l.dir = iterateNone
l.maxSize = 0 l.maxSize = 0
@@ -65,9 +68,9 @@ func (l *List) Dragging() bool {
return l.scroll.Dragging() return l.scroll.Dragging()
} }
func (l *List) Update(c *ui.Config, q input.Events) { func (l *List) update() {
l.Distance = 0 l.Distance = 0
d := l.scroll.Update(c, q, gesture.Axis(l.Axis)) d := l.scroll.Update(l.Config, l.Inputs, gesture.Axis(l.Axis))
if l.Invert { if l.Invert {
d = -d d = -d
} }