mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-28 05:12:34 +00:00
fix addition vs subtraction for ConcentricPattern
This commit is contained in:
@@ -261,7 +261,7 @@ pub fn CenterOfRings(
|
|||||||
let mut sum = center;
|
let mut sum = center;
|
||||||
for i in 2..(numOfRings + 1) {
|
for i in 2..(numOfRings + 1) {
|
||||||
// for (int i = 1; i < numOfRings; ++i) {
|
// for (int i = 1; i < numOfRings; ++i) {
|
||||||
let c = CenterOfRing(image, center.floor(), range, i as i32, false)?;
|
let c = CenterOfRing(image, center.floor(), range, i as i32, true)?;
|
||||||
|
|
||||||
if (c == Point::default()) {
|
if (c == Point::default()) {
|
||||||
if n == 1 {
|
if n == 1 {
|
||||||
@@ -532,7 +532,7 @@ impl std::ops::Add for ConcentricPattern {
|
|||||||
type Output = Self;
|
type Output = Self;
|
||||||
|
|
||||||
fn add(self, rhs: Self) -> Self::Output {
|
fn add(self, rhs: Self) -> Self::Output {
|
||||||
let new_p = self.p - rhs.p;
|
let new_p = self.p + rhs.p;
|
||||||
Self {
|
Self {
|
||||||
p: new_p,
|
p: new_p,
|
||||||
size: self.size,
|
size: self.size,
|
||||||
|
|||||||
Reference in New Issue
Block a user