And fixed the "270" issue: logic error in computing the "skip" allowed after finding two finder patterns when the QR Code was inverted.

git-svn-id: https://zxing.googlecode.com/svn/trunk@486 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-06-26 22:58:08 +00:00
parent 621a9f25e9
commit dd57042f9a
3 changed files with 7 additions and 7 deletions

View file

@ -411,7 +411,7 @@ final class FinderPatternFinder {
// difference in the x / y coordinates of the two centers.
// This is the case where you find top left first. Draw it out.
hasSkipped = true;
return (int) Math.abs(Math.abs(firstConfirmedCenter.getX() - center.getX()) -
return (int) (Math.abs(firstConfirmedCenter.getX() - center.getX()) -
Math.abs(firstConfirmedCenter.getY() - center.getY()));
}
}

View file

@ -29,10 +29,10 @@ public final class QRCodeBlackBox1TestCase extends AbstractBlackBoxTestCase {
public QRCodeBlackBox1TestCase() {
super(new File("test/data/blackbox/qrcode-1"), new MultiFormatReader(), BarcodeFormat.QR_CODE);
addTest(16, 0.0f);
addTest(12, 90.0f);
addTest(12, 180.0f);
addTest(7, 270.0f);
addTest(18, 0.0f);
addTest(14, 90.0f);
addTest(18, 180.0f);
addTest(14, 270.0f);
}
}

View file

@ -31,8 +31,8 @@ public final class QRCodeBlackBox2TestCase extends AbstractBlackBoxTestCase {
super(new File("test/data/blackbox/qrcode-2"), new MultiFormatReader(), BarcodeFormat.QR_CODE);
addTest(10, 0.0f);
addTest(6, 90.0f);
addTest(8, 180.0f);
addTest(2, 270.0f);
addTest(9, 180.0f);
addTest(7, 270.0f);
}
}