minor change
This commit is contained in:
parent
5daaad80dc
commit
d905c04479
|
@ -21,8 +21,9 @@ type Picture struct {
|
||||||
// NewPicture creates a new picture from an image.Image.
|
// NewPicture creates a new picture from an image.Image.
|
||||||
func NewPicture(img image.Image, smooth bool) *Picture {
|
func NewPicture(img image.Image, smooth bool) *Picture {
|
||||||
// convert the image to NRGBA format
|
// convert the image to NRGBA format
|
||||||
nrgba := image.NewNRGBA(image.Rect(0, 0, img.Bounds().Dx(), img.Bounds().Dy()))
|
bounds := img.Bounds()
|
||||||
draw.Draw(nrgba, nrgba.Bounds(), img, img.Bounds().Min, draw.Src)
|
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
|
var texture *pixelgl.Texture
|
||||||
mainthread.Call(func() {
|
mainthread.Call(func() {
|
||||||
|
|
Loading…
Reference in New Issue