From 0ab13221720b946886d947ac3b0d94ac47f58dad Mon Sep 17 00:00:00 2001 From: Florian Sundermann Date: Thu, 12 Dec 2013 14:04:36 +0100 Subject: [PATCH] fixed bug in calcPenaltyRule1 --- qr/qrcode.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qr/qrcode.go b/qr/qrcode.go index 14f956d..fc9f4f1 100644 --- a/qr/qrcode.go +++ b/qr/qrcode.go @@ -64,7 +64,7 @@ func (qr *qrcode) calcPenaltyRule1() uint { if cntX >= 5 { result += cntX - 2 } - cntX = 0 + cntX = 1 } if qr.Get(y, x) == checkForY { @@ -74,7 +74,7 @@ func (qr *qrcode) calcPenaltyRule1() uint { if cntY >= 5 { result += cntY - 2 } - cntY = 0 + cntY = 1 } }