mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
in_progress port from cpp
This commit is contained in:
@@ -499,6 +499,24 @@ impl std::ops::Sub for ConcentricPattern {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Add for ConcentricPattern {
|
||||
type Output = Self;
|
||||
|
||||
fn add(self, rhs: Self) -> Self::Output {
|
||||
let new_p = self.p - rhs.p;
|
||||
Self {
|
||||
p: new_p,
|
||||
size: self.size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Point> for ConcentricPattern {
|
||||
fn from(value: Point) -> Self {
|
||||
Self { p: value, size: 0 }
|
||||
}
|
||||
}
|
||||
|
||||
impl ConcentricPattern {
|
||||
pub fn dot(self, other: ConcentricPattern) -> f32 {
|
||||
Point::dot(self.p, other.p)
|
||||
|
||||
Reference in New Issue
Block a user