From 45e8c781e23ea70eef32715d82b2d2a656f46153 Mon Sep 17 00:00:00 2001 From: Thomas Mathews Date: Mon, 2 May 2022 19:24:18 -0700 Subject: [PATCH] layout: improve layout.List documentation Updated the documentation for layout.List to include the details about how drawing is performed for items in it. This gives the user an understanding about how so many items can be drawn for performance. Signed-off-by: Thomas Mathews --- layout/list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layout/list.go b/layout/list.go index b56922d6..71972e8e 100644 --- a/layout/list.go +++ b/layout/list.go @@ -101,7 +101,9 @@ func (l *List) init(gtx Context, len int) { } } -// Layout the List. +// Layout a List of len items, where each item is implicitly defined +// by the callback w. Layout can handle very large lists because it only calls +// w to fill its viewport and the distance scrolled, if any. func (l *List) Layout(gtx Context, len int, w ListElement) Dimensions { l.init(gtx, len) crossMin, crossMax := l.Axis.crossConstraint(gtx.Constraints)