From d5b8343ac47af886d033d2c7a2d2465473d06de5 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Sat, 12 Sep 2026 15:46:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=86=85=E5=AD=98=E5=8D=A0=E7=94=A8):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87=E8=A3=81=E5=89=AA=EF=BC=8C?= =?UTF-8?q?=E5=87=8F=E5=B0=91=E5=86=85=E5=AD=98=E5=88=86=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ofdgo_renderer_image.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ofdgo_renderer_image.go b/ofdgo_renderer_image.go index 1f5ebef..f473524 100644 --- a/ofdgo_renderer_image.go +++ b/ofdgo_renderer_image.go @@ -205,8 +205,8 @@ func imageWithClip(img image.Image, clipPath *canvas.Path, m canvas.Matrix) imag return img } source := imagePixelSource(img) - out := image.NewNRGBA(bounds) if src, ok := source.(*image.NRGBA); ok { + out := image.NewNRGBA(bounds) for y := 0; y < h; y++ { offset := src.PixOffset(bounds.Min.X, bounds.Min.Y+y) row := out.Pix[y*out.Stride : y*out.Stride+w*4] @@ -218,6 +218,7 @@ func imageWithClip(img image.Image, clipPath *canvas.Path, m canvas.Matrix) imag } return out } + out := &image.NRGBA{Pix: mask.Pix, Stride: mask.Stride, Rect: bounds} for y := bounds.Min.Y; y < bounds.Max.Y; y++ { for x := bounds.Min.X; x < bounds.Max.X; x++ { c := imageNRGBAAt(source, x, y)