From ff19c252c1fb6ccf8d5ca2088ee1bf3e439f822e Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Thu, 15 Feb 2024 03:28:12 +0000 Subject: [PATCH] shape: don't inflate seg front and back to prevent false infringements --- src/layout/geometry/shape.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/layout/geometry/shape.rs b/src/layout/geometry/shape.rs index 9ff939e..43e924d 100644 --- a/src/layout/geometry/shape.rs +++ b/src/layout/geometry/shape.rs @@ -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, }) }