Start copying at bounds min instead of zero point

This commit is contained in:
Tim Schaub 2018-03-15 21:28:47 -06:00
parent c97f757e6f
commit ca366ba15b

View File

@ -54,8 +54,9 @@ func SavePNG(path string, im image.Image) error {
}
func imageToRGBA(src image.Image) *image.RGBA {
dst := image.NewRGBA(src.Bounds())
draw.Draw(dst, dst.Rect, src, image.ZP, draw.Src)
bounds := src.Bounds()
dst := image.NewRGBA(bounds)
draw.Draw(dst, bounds, src, bounds.Min, draw.Src)
return dst
}