mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
remove MathUtils::round()
This commit is contained in:
@@ -17,10 +17,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
common::{
|
||||
detector::MathUtils, BitMatrix, DefaultGridSampler, GridSampler, PerspectiveTransform,
|
||||
Result,
|
||||
},
|
||||
common::{BitMatrix, DefaultGridSampler, GridSampler, PerspectiveTransform, Result},
|
||||
qrcode::decoder::Version,
|
||||
result_point_utils, DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions, Point,
|
||||
PointCallback, ResultPoint,
|
||||
@@ -235,9 +232,9 @@ impl<'a> Detector<'_> {
|
||||
moduleSize: f32,
|
||||
) -> Result<u32> {
|
||||
let tltrCentersDimension =
|
||||
MathUtils::round(result_point_utils::distance(topLeft, topRight) / moduleSize);
|
||||
(result_point_utils::distance(topLeft, topRight) / moduleSize).round() as i32;
|
||||
let tlblCentersDimension =
|
||||
MathUtils::round(result_point_utils::distance(topLeft, bottomLeft) / moduleSize);
|
||||
(result_point_utils::distance(topLeft, bottomLeft) / moduleSize).round() as i32;
|
||||
let mut dimension = ((tltrCentersDimension + tlblCentersDimension) / 2) + 7;
|
||||
match dimension & 0x03 {
|
||||
0 => dimension += 1,
|
||||
|
||||
Reference in New Issue
Block a user