we really should be using round, but why is it worse?

This commit is contained in:
Henry Schimke
2022-10-11 07:38:50 -05:00
parent c190933f5f
commit 81f6de2a8f
4 changed files with 4 additions and 4 deletions

View File

@@ -290,7 +290,7 @@ impl AlignmentPatternFinder {
let centerJ = Self::centerFromEnd(stateCount, j);
let centerI = self.crossCheckVertical(
i,
centerJ.floor() as u32,
centerJ.round() as u32,
2 * stateCount[1],
stateCountTotal,
);

View File

@@ -92,7 +92,7 @@ impl FinderPattern {
combinedX,
combinedY,
combinedModuleSize,
combinedCount.floor() as usize,
combinedCount.round() as usize,
)
}
}

View File

@@ -620,7 +620,7 @@ impl FinderPatternFinder {
return (((fnp.getX() - center.getX().abs())
- (fnp.getY() - center.getY()).abs())
/ 2.0)
.floor() as u32;
.round() as u32;
}
}
}