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 <thomas.c.mathews@gmail.com>
This commit is contained in:
Thomas Mathews
2022-05-02 19:24:18 -07:00
committed by Elias Naur
parent a9a9a7c02f
commit 45e8c781e2
+3 -1
View File
@@ -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 { func (l *List) Layout(gtx Context, len int, w ListElement) Dimensions {
l.init(gtx, len) l.init(gtx, len)
crossMin, crossMax := l.Axis.crossConstraint(gtx.Constraints) crossMin, crossMax := l.Axis.crossConstraint(gtx.Constraints)