Minor deletion of code that shouldn't have been committed
[zxing.git] / core / src / com / google / zxing / common / detector / WhiteRectangleDetector.java
index 030d3a2..cb889dd 100644 (file)
@@ -83,6 +83,11 @@ public final class WhiteRectangleDetector {
           aBlackPointFoundOnBorder = true;
         }
       }
+      
+      if (right >= width) {
+          sizeExceeded = true;
+          break;
+      }
 
       // .....
       // .   .
@@ -95,6 +100,11 @@ public final class WhiteRectangleDetector {
           aBlackPointFoundOnBorder = true;
         }
       }
+      
+      if (down >= height) {
+          sizeExceeded = true;
+          break;
+      }
 
       // .....
       // |   .
@@ -107,6 +117,11 @@ public final class WhiteRectangleDetector {
           aBlackPointFoundOnBorder = true;
         }
       }
+      
+      if (left < 0) {
+          sizeExceeded = true;
+          break;
+      }
 
       // .___.
       // .   .
@@ -120,7 +135,7 @@ public final class WhiteRectangleDetector {
         }
       }
 
-      if (right >= width || down >= height || up < 0 || left < 0) {
+      if (up < 0) {
         sizeExceeded = true;
         break;
       }
@@ -271,20 +286,20 @@ public final class WhiteRectangleDetector {
   private boolean containsBlackPoint(int a, int b, int fixed, boolean horizontal) {
 
     if (horizontal) {
-      for (int x = a; x < b; x++) {
+      for (int x = a; x <= b; x++) {
         if (image.get(x, fixed)) {
           return true;
         }
       }
     } else {
-      for (int y = a; y < b; y++) {
+      for (int y = a; y <= b; y++) {
         if (image.get(fixed, y)) {
           return true;
                                }
-                       }
                }
-
-               return false;
        }
 
+       return false;
+  }
+
 }
\ No newline at end of file