mirror of https://codeberg.org/topola/topola.git
shape: don't inflate seg front and back to prevent false infringements
This commit is contained in:
parent
6fa6ec7527
commit
ff19c252c1
|
|
@ -125,11 +125,9 @@ impl ShapeTrait for SegShape {
|
|||
}
|
||||
|
||||
fn inflate(&self, margin: f64) -> Shape {
|
||||
let mag = (self.to - self.from).euclidean_distance(&point! {x: 0.0, y: 0.0});
|
||||
|
||||
Shape::Seg(SegShape {
|
||||
from: self.from + (self.from - self.to) / mag * margin,
|
||||
to: self.to + (self.to - self.from) / mag * margin,
|
||||
from: self.from,
|
||||
to: self.to,
|
||||
width: self.width + 2.0 * margin,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue