mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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:
committed by
Elias Naur
parent
a9a9a7c02f
commit
45e8c781e2
+3
-1
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user