From 7558f0253817dc04d5d1264a0ed1c840f061e60f Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Fri, 12 Oct 2018 13:12:15 -0700 Subject: [PATCH] correct image.Image implementation codeImage.At didn't take scaling or the image border into account when looking up pixel values. --- qr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qr.go b/qr.go index ace7e6f..ba9fdcb 100644 --- a/qr.go +++ b/qr.go @@ -105,7 +105,7 @@ func (c *codeImage) Bounds() image.Rectangle { } func (c *codeImage) At(x, y int) color.Color { - if c.Black(x, y) { + if c.Black(x/c.Scale-4, y/c.Scale-4) { return blackColor } return whiteColor