minor change

This commit is contained in:
faiface 2017-01-20 22:50:51 +01:00
parent 5daaad80dc
commit d905c04479
1 changed files with 3 additions and 2 deletions

View File

@ -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() {