diff --git a/src/common/mod.rs b/src/common/mod.rs index eca541a..25a94c3 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -2363,7 +2363,7 @@ impl GridSampler for DefaultGridSampler { let mut x = 0; while x < max { // for (int x = 0; x < max; x += 2) { - if image.get(points[x].round() as u32, points[x + 1].round() as u32) { + if image.get(points[x].floor() as u32, points[x + 1].floor() as u32) { // Black(-ish) pixel bits.set(x as u32 / 2, y); } diff --git a/src/qrcode/detector/alignment_pattern_finder.rs b/src/qrcode/detector/alignment_pattern_finder.rs index 2038007..ddb0517 100644 --- a/src/qrcode/detector/alignment_pattern_finder.rs +++ b/src/qrcode/detector/alignment_pattern_finder.rs @@ -290,7 +290,7 @@ impl AlignmentPatternFinder { let centerJ = Self::centerFromEnd(stateCount, j); let centerI = self.crossCheckVertical( i, - centerJ.round() as u32, + centerJ.floor() as u32, 2 * stateCount[1], stateCountTotal, ); diff --git a/src/qrcode/detector/finder_pattern.rs b/src/qrcode/detector/finder_pattern.rs index 487eed9..a79c2ad 100644 --- a/src/qrcode/detector/finder_pattern.rs +++ b/src/qrcode/detector/finder_pattern.rs @@ -92,7 +92,7 @@ impl FinderPattern { combinedX, combinedY, combinedModuleSize, - combinedCount.round() as usize, + combinedCount.floor() as usize, ) } } diff --git a/src/qrcode/detector/finder_pattern_finder.rs b/src/qrcode/detector/finder_pattern_finder.rs index 7d4d4d0..00261a1 100755 --- a/src/qrcode/detector/finder_pattern_finder.rs +++ b/src/qrcode/detector/finder_pattern_finder.rs @@ -620,7 +620,7 @@ impl FinderPatternFinder { return (((fnp.getX() - center.getX().abs()) - (fnp.getY() - center.getY()).abs()) / 2.0) - .round() as u32; + .floor() as u32; } } }