mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
v0.4.3
This commit is contained in:
@@ -265,6 +265,11 @@ impl BitMatrix {
|
||||
(self.get_offset(y, x)) >= self.bits.len()
|
||||
}
|
||||
|
||||
/// Confusingly returns true if the requested element is out of bounds
|
||||
pub fn check_point_in_bounds(&self, point: Point) -> bool {
|
||||
self.check_in_bounds(point.x as u32, point.y as u32)
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Sets the given bit to true.</p>
|
||||
*
|
||||
|
||||
@@ -281,9 +281,7 @@ impl Circle<'_> {
|
||||
// count left
|
||||
while {
|
||||
let point = get_point(self.center, (x, y), rotation);
|
||||
!self.image.check_in_bounds(point.x as u32, point.y as u32)
|
||||
&& !self.image.get(point.x as u32, point.y as u32)
|
||||
&& x > 0
|
||||
!self.image.check_point_in_bounds(point) && !self.image.get_point(point) && x > 0
|
||||
} {
|
||||
x -= 1;
|
||||
length += 1;
|
||||
@@ -295,8 +293,7 @@ impl Circle<'_> {
|
||||
// count right
|
||||
while {
|
||||
let point = get_point(self.center, (x, y), rotation);
|
||||
!self.image.check_in_bounds(point.x as u32, point.y as u32)
|
||||
&& !self.image.get(point.x as u32, point.y as u32)
|
||||
!self.image.check_point_in_bounds(point) && !self.image.get_point(point)
|
||||
} {
|
||||
x += 1;
|
||||
length += 1;
|
||||
|
||||
Reference in New Issue
Block a user