From 4e7e3956db413f38d494797dea5c4869d3d7b25f Mon Sep 17 00:00:00 2001 From: Ousmane Traore Date: Sun, 30 Apr 2017 19:30:11 -0400 Subject: [PATCH] Set value rather than append --- pixelgl/window.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pixelgl/window.go b/pixelgl/window.go index e76aaf2..74b69d4 100644 --- a/pixelgl/window.go +++ b/pixelgl/window.go @@ -132,9 +132,9 @@ func NewWindow(cfg WindowConfig) (*Window, error) { runtime.SetFinalizer(w, (*Window).Destroy) imgs := make([]image.Image, len(cfg.Icon)) - for _, v := range cfg.Icon { + for i, v := range cfg.Icon { pic := pixel.PictureDataFromPicture(v) - imgs = append(imgs, pic.Image()) + imgs[i] = pic.Image() } mainthread.Call(func() { w.window.SetIcon(imgs)