Merge pull request #86 from SolarLune/master

Fix: NewImageFromImage() height incorrect.
This commit is contained in:
Milan Nikolic 2019-10-04 12:05:18 +02:00 committed by GitHub
commit 02424e2e10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1113,7 +1113,7 @@ func NewImageFromImage(img image.Image) *Image {
for x := 0; x < size.X; x++ {
color := img.At(x, y)
r, g, b, a := color.RGBA()
pixels[x+y*size.Y] = NewColor(uint8(r), uint8(g), uint8(b), uint8(a))
pixels[x+y*size.X] = NewColor(uint8(r), uint8(g), uint8(b), uint8(a))
}
}