~eliasnaur/gio-patches

gio: op/paint: Correct image loading v1 PROPOSED

~strosel
~strosel: 1
 op/paint: Correct image loading

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/9496/mbox | git am -3
Learn more about email & git

[PATCH gio] op/paint: Correct image loading Export this patch

~strosel
From: axel paulander <axel.paulander@gmail.com>

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>
---
 op/paint/paint.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/op/paint/paint.go b/op/paint/paint.go
index 77ec570..296a75e 100644
--- a/op/paint/paint.go
+++ b/op/paint/paint.go
@@ -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),
-- 
2.24.1
Thanks!

To git.sr.ht:~eliasnaur/gio
   631c3b0..2e66c90  master -> master
View this thread in the archives