mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
Revert "we really should be using round, but why is it worse?"
This reverts commit 81f6de2a8f.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
@@ -92,7 +92,7 @@ impl FinderPattern {
|
||||
combinedX,
|
||||
combinedY,
|
||||
combinedModuleSize,
|
||||
combinedCount.round() as usize,
|
||||
combinedCount.floor() as usize,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user