From 225c73f012083cd3c78555e03edb7de5527cd239 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 6 Oct 2019 12:29:35 +0200 Subject: [PATCH] text: move Label.it to a local variable Signed-off-by: Elias Naur --- text/label.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/text/label.go b/text/label.go index adfbecba..84c8c9c3 100644 --- a/text/label.go +++ b/text/label.go @@ -33,8 +33,6 @@ type Label struct { Text string // MaxLines limits the number of lines. Zero means no limit. MaxLines int - - it lineIterator } type lineIterator struct { @@ -110,14 +108,14 @@ func (l Label) Layout(gtx *layout.Context, family Family) { Min: image.Point{X: -inf, Y: -padTop}, Max: image.Point{X: inf, Y: dims.Size.Y + padBottom}, } - l.it = lineIterator{ + it := lineIterator{ Lines: lines, Clip: clip, Alignment: l.Alignment, Width: dims.Size.X, } for { - str, off, ok := l.it.Next() + str, off, ok := it.Next() if !ok { break }