From: Michael Orlitzky Date: Fri, 2 Sep 2011 13:13:55 +0000 (-0400) Subject: Add another guard on calculate_containing_cube_coordinate. X-Git-Tag: 0.0.1~182 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=29ffefd3c892f38eee96fdd672ceab4d0454cd90;p=spline3.git Add another guard on calculate_containing_cube_coordinate. --- diff --git a/src/Grid.hs b/src/Grid.hs index 8bf8382..7325d2b 100644 --- a/src/Grid.hs +++ b/src/Grid.hs @@ -96,6 +96,7 @@ calculate_containing_cube_coordinate g coord -- returns cube #1 if we would have returned cube #0 and cube #1 -- exists. | coord == offset && (xsize > 0 && ysize > 0 && zsize > 0) = 1 + | coord < offset = 0 | otherwise = (ceiling ( (coord + offset) / cube_width )) - 1 where (xsize, ysize, zsize) = dims (function_values g)