mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
Fixed crash
This commit is contained in:
@@ -281,7 +281,9 @@ impl Circle<'_> {
|
|||||||
// count left
|
// count left
|
||||||
while {
|
while {
|
||||||
let point = get_point(self.center, (x, y), rotation);
|
let point = get_point(self.center, (x, y), rotation);
|
||||||
!self.image.get(point.x as u32, point.y as u32) && x > 0
|
!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
|
||||||
} {
|
} {
|
||||||
x -= 1;
|
x -= 1;
|
||||||
length += 1;
|
length += 1;
|
||||||
@@ -293,7 +295,8 @@ impl Circle<'_> {
|
|||||||
// count right
|
// count right
|
||||||
while {
|
while {
|
||||||
let point = get_point(self.center, (x, y), rotation);
|
let point = get_point(self.center, (x, y), rotation);
|
||||||
!self.image.get(point.x as u32, point.y as u32)
|
!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 += 1;
|
x += 1;
|
||||||
length += 1;
|
length += 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user