From c3f30188a573d73e7d4cfea6dd969e902422779d Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 24 Aug 2019 18:25:37 +0100 Subject: [PATCH] all: delete unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Daniel Martí. Fixes gio#24 Signed-off-by: Elias Naur --- ui/app/internal/gpu/gpu.go | 5 ++--- ui/text/label.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/app/internal/gpu/gpu.go b/ui/app/internal/gpu/gpu.go index dfb1764d..9392a976 100644 --- a/ui/app/internal/gpu/gpu.go +++ b/ui/app/internal/gpu/gpu.go @@ -304,9 +304,8 @@ func (g *GPU) renderLoop(glctx gl.Context) error { ops := frame.ops // Upload path data to GPU before ack'ing the frame data for re-use. for _, p := range ops.pathOps { - data, exists := g.pathCache.get(p.pathKey) - if !exists { - data = buildPath(r.ctx, p.pathVerts) + if _, exists := g.pathCache.get(p.pathKey); !exists { + data := buildPath(r.ctx, p.pathVerts) g.pathCache.put(p.pathKey, data) } p.pathVerts = nil diff --git a/ui/text/label.go b/ui/text/label.go index fcb0dbf2..9eb26e7b 100644 --- a/ui/text/label.go +++ b/ui/text/label.go @@ -55,7 +55,7 @@ func (l *lineIterator) Next() (String, f32.Point, bool) { l.prevDesc = line.Descent // Align baseline and line start to the pixel grid. off := fixed.Point26_6{X: fixed.I(x.Floor()), Y: fixed.I(l.y.Ceil())} - x, l.y = off.X, off.Y + l.y = off.Y off.Y += fixed.I(l.Offset.Y) if (off.Y + line.Bounds.Min.Y).Floor() > l.Clip.Max.Y { break