changeset 1922:28ad7feeb545

Fix autocrop checks.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 08 Nov 2017 00:18:12 +0200
parents 2761364c9044
children 29a2223814f8
files mapsearch.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mapsearch.c	Tue Nov 07 19:39:58 2017 +0200
+++ b/mapsearch.c	Wed Nov 08 00:18:12 2017 +0200
@@ -624,10 +624,11 @@
 
     // Step #2: Check if the boundaries are any smaller than
     // the current block size
-    if (x0 == 0 && y0 == 0 && x1 == (*pmap)->width - 1 && y1 == (*pmap)->height - 1)
+    if (x0 == 0 && y0 == 0 &&
+        x1 == (*pmap)->width - 1 && y1 == (*pmap)->height - 1)
         return FALSE;
 
-    if (x1 - x0 <= 0 || y1 - y0 <= 0)
+    if (x1 - x0 < 0 || y1 - y0 < 0)
         return FALSE;
 
     // Step #3: Allocate new block and copy the cropped data