Skip to content

Commit

Permalink
refactor: image/imageutil/padding: use image.Point{} vs. deprecat…
Browse files Browse the repository at this point in the history
…ed `image.ZP`
  • Loading branch information
grokify committed Aug 25, 2024
1 parent 9ea44a3 commit 81976f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions image/imageutil/padding/padding.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ func CreateIsPaddingFuncSimple(paddingColor color.Color) func(testColor color.Co

func AddPaddingUniform(im image.Image, paddingWidth uint, paddingColor color.Color) image.Image {
out := image.NewRGBA(image.Rect(0, 0, im.Bounds().Dx()+int(2*paddingWidth), im.Bounds().Dy()+int(2*paddingWidth)))
draw.Draw(out, out.Bounds(), &image.Uniform{paddingColor}, image.ZP, draw.Src)
draw.Draw(out, out.Bounds(), &image.Uniform{paddingColor}, image.Point{}, draw.Src)
draw.Draw(out, image.Rect(
int(paddingWidth),
int(paddingWidth),
out.Bounds().Max.X-1-int(paddingWidth),
out.Bounds().Max.Y-1-int(paddingWidth)), im, image.ZP, draw.Over)
out.Bounds().Max.Y-1-int(paddingWidth)), im, image.Point{}, draw.Over)
return out
}

Expand Down

0 comments on commit 81976f9

Please sign in to comment.