From d905c04479744c66bb2b81cb0625de44338c7897 Mon Sep 17 00:00:00 2001 From: faiface Date: Fri, 20 Jan 2017 22:50:51 +0100 Subject: [PATCH] minor change --- picture.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/picture.go b/picture.go index 00b5070..ef17326 100644 --- a/picture.go +++ b/picture.go @@ -21,8 +21,9 @@ type Picture struct { // NewPicture creates a new picture from an image.Image. func NewPicture(img image.Image, smooth bool) *Picture { // convert the image to NRGBA format - nrgba := image.NewNRGBA(image.Rect(0, 0, img.Bounds().Dx(), img.Bounds().Dy())) - draw.Draw(nrgba, nrgba.Bounds(), img, img.Bounds().Min, draw.Src) + bounds := img.Bounds() + nrgba := image.NewNRGBA(image.Rect(0, 0, bounds.Dx(), bounds.Dy())) + draw.Draw(nrgba, nrgba.Bounds(), img, bounds.Min, draw.Src) var texture *pixelgl.Texture mainthread.Call(func() {