[PATCH gio] op/paint: Correct image loading
Export this patch
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
Does this fix your issue #79? If so, add
Fixes #79
to the commit message.
---
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
Thank you. Please sign off your patch according to gioui.org/doc/contribute.
On Fri Jan 10, 2020 at 1:14 AM, ~strosel wrote: