And fixed the "270" issue: logic error in computing the "skip" allowed after finding...
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 26 Jun 2008 22:58:08 +0000 (22:58 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 26 Jun 2008 22:58:08 +0000 (22:58 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@486 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/src/com/google/zxing/qrcode/detector/FinderPatternFinder.java
core/test/src/com/google/zxing/qrcode/QRCodeBlackBox1TestCase.java
core/test/src/com/google/zxing/qrcode/QRCodeBlackBox2TestCase.java

index 160fd75..543467d 100755 (executable)
@@ -411,7 +411,7 @@ final class FinderPatternFinder {
           // difference in the x / y coordinates of the two centers.\r
           // This is the case where you find top left first. Draw it out.\r
           hasSkipped = true;\r
-          return (int) Math.abs(Math.abs(firstConfirmedCenter.getX() - center.getX()) -\r
+          return (int) (Math.abs(firstConfirmedCenter.getX() - center.getX()) -\r
               Math.abs(firstConfirmedCenter.getY() - center.getY()));\r
         }\r
       }\r
index ddbe2e7..3a27867 100644 (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);
   }
 
 }
\ No newline at end of file
index 06707e7..ffe3485 100644 (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);
   }
 
 }
\ No newline at end of file