From c3b33330df1a5152852216b465cc6effa2b3d17c Mon Sep 17 00:00:00 2001
From: tpylak <tpylak>
Date: Mon, 28 Jan 2008 14:34:23 +0000
Subject: [PATCH] bugfix: image from the last tile was always considered
 invalid This is pretty serious bug from the user point of view.

SVN: 3821
---
 bds/source/java/ch/systemsx/cisd/bds/hcs/Location.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bds/source/java/ch/systemsx/cisd/bds/hcs/Location.java b/bds/source/java/ch/systemsx/cisd/bds/hcs/Location.java
index a18f6750fcb..b110adec656 100644
--- a/bds/source/java/ch/systemsx/cisd/bds/hcs/Location.java
+++ b/bds/source/java/ch/systemsx/cisd/bds/hcs/Location.java
@@ -47,6 +47,7 @@ public final class Location
 
     /**
      * For given <var>position</var> in given <code>geometry</code> returns corresponding <code>Location</code>.
+     * Position should be greater than 0.
      * 
      * @return <code>null</code> if position is out of range.
      */
@@ -56,7 +57,7 @@ public final class Location
         final int columns = geometry.getColumns();
         final int max = columns * geometry.getRows();
         // Given position is within the range.
-        if (position > 0 && position < max)
+        if (position > 0 && position <= max)
         {
             final int modulo = position % columns;
             final int x = modulo == 0 ? columns : modulo;
-- 
GitLab