mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
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:
committed by
Elias Naur
parent
631c3b0e02
commit
2e66c90aee
+1
-1
@@ -59,7 +59,7 @@ func NewImageOp(src image.Image) ImageOp {
|
|||||||
dst := image.NewRGBA(image.Rectangle{
|
dst := image.NewRGBA(image.Rectangle{
|
||||||
Max: sz,
|
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{
|
return ImageOp{
|
||||||
src: dst,
|
src: dst,
|
||||||
handle: new(int),
|
handle: new(int),
|
||||||
|
|||||||
Reference in New Issue
Block a user