forked from joejulian/gio
layout: simplify implementation of List.ScrollTo
Signed-off-by: Dominik Honnef <dominik@honnef.co>
This commit is contained in:
committed by
Elias Naur
parent
4a1962e5e8
commit
dc9a4a4009
+2
-2
@@ -381,7 +381,7 @@ func (l *List) ScrollBy(num float32) {
|
||||
// ScrollTo scrolls to the specified item. THe result will only be accurate if all items have the same height.
|
||||
// Otherwise, it will be approximate.
|
||||
func (l *List) ScrollTo(n int) {
|
||||
l.Position.First = 0
|
||||
l.Position.First = n
|
||||
l.Position.Offset = 0
|
||||
l.ScrollBy(float32(n))
|
||||
l.Position.BeforeEnd = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user