op/paint: correct image loading

Corrected the use of draw.Draw in paint.NewImageOp as the old use only works for images starting at the origin

Signed-off-by: Axel Paulander <axel.paulander@gmail.com>
This commit is contained in:
axel paulander
2020-01-10 01:14:53 +01:00
committed by Elias Naur
parent 631c3b0e02
commit 2e66c90aee
+1 -1
View File
@@ -59,7 +59,7 @@ func NewImageOp(src image.Image) ImageOp {
dst := image.NewRGBA(image.Rectangle{
Max: sz,
})
draw.Draw(dst, src.Bounds(), src, image.Point{}, draw.Src)
draw.Draw(dst, dst.Bounds(), src, src.Bounds().Min, draw.Src)
return ImageOp{
src: dst,
handle: new(int),