Little bug fix affecting QR Codes that run all the way to the left/top edge of an image

git-svn-id: https://zxing.googlecode.com/svn/trunk@215 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-02-19 21:49:26 +00:00
parent 82bc8e437a
commit 4525328e45
3 changed files with 17 additions and 2 deletions

View file

@ -178,13 +178,15 @@ public final class Detector {
// Now count other way -- don't run off image though of course
int otherToX = fromX - (toX - fromX);
if (otherToX < 0) {
otherToX = 0;
// "to" should the be the first value not included, so, the first value off
// the edge is -1
otherToX = -1;
} else if (otherToX >= image.getWidth()) {
otherToX = image.getWidth();
}
int otherToY = fromY - (toY - fromY);
if (otherToY < 0) {
otherToY = 0;
otherToY = -1;
} else if (otherToY >= image.getHeight()) {
otherToY = image.getHeight();
}

View file

@ -0,0 +1,12 @@
BEGIN:VCARD
N:Kennedy;Steve
TEL:+44 (0)7775 755503
ADR;HOME:;;Flat 2, 43 Howitt Road, Belsize Park;London;;NW34LU;UK
ORG:NetTek Ltd;
TITLE:Consultant
EMAIL:steve@nettek.co.uk
URL:www.nettek.co.uk
EMAIL;IM:MSN:steve@gbnet.net
NOTE:Testing 1 2 3
BDAY:19611105
END:VCARD

View file

@ -0,0 +1 @@
http://www.d-co.de/images/qrcode_eg1.gif