From 5599b92bd25380c4ecd02a0db394327b89dabf1b Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 22 Mar 2022 12:19:52 -0400 Subject: [PATCH] fix --- src/misc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc.rs b/src/misc.rs index d48759b..45cb671 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -31,7 +31,7 @@ impl SteppedVector { } // Do some math in order to calculate the expected index value - let possible_i = ((x + self.min) / self.step) as usize; + let possible_i = (((x + self.min) / self.step) as usize) - 1; // Make sure that the index is valid by checking the data returned vs the actual // data (just in case)