diff --git a/src/draw.rs b/src/draw.rs index 9a5fe33..3eb13d1 100644 --- a/src/draw.rs +++ b/src/draw.rs @@ -262,7 +262,12 @@ impl<'a> Draw<'a> { let bend = self .layout - .add_fixed_bend(head.dot, bend_to, around, FixedBendWeight { net, cw }) + .add_fixed_bend( + head.dot, + bend_to, + around, + FixedBendWeight { net, width, cw }, + ) .map_err(|err| { self.layout.remove(bend_to.into()); self.undo_seg(head, seg); diff --git a/src/graph.rs b/src/graph.rs index 4de4fdd..b91142d 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -171,7 +171,6 @@ impl SegWeight for FixedSegWeight {} #[derive(Debug, Clone, Copy, PartialEq)] pub struct HalfLooseSegWeight { pub net: i64, - pub width: f64, } impl_type!(HalfLooseSegWeight, HalfLooseSeg, HalfLooseSegIndex); @@ -180,7 +179,6 @@ impl SegWeight for HalfLooseSegWeight {} #[derive(Debug, Clone, Copy, PartialEq)] pub struct FullyLooseSegWeight { pub net: i64, - pub width: f64, } impl_type!(FullyLooseSegWeight, FullyLooseSeg, FullyLooseSegIndex); @@ -191,6 +189,7 @@ pub trait BendWeight: GetNet + Into + Copy {} #[derive(Debug, Clone, Copy, PartialEq)] pub struct FixedBendWeight { pub net: i64, + pub width: f64, pub cw: bool, } diff --git a/src/primitive.rs b/src/primitive.rs index dbf93fb..9badf9c 100644 --- a/src/primitive.rs +++ b/src/primitive.rs @@ -267,7 +267,7 @@ impl<'a> MakeShape for HalfLooseSeg<'a> { Shape::Seg(SegShape { from: self.primitive(ends.0).weight().circle.pos, to: self.primitive(ends.1).weight().circle.pos, - width: self.weight().width, + width: self.primitive(ends.1).weight().circle.r * 2.0, }) } } @@ -293,7 +293,7 @@ impl<'a> MakeShape for FullyLooseSeg<'a> { Shape::Seg(SegShape { from: self.primitive(ends.0).weight().circle.pos, to: self.primitive(ends.1).weight().circle.pos, - width: self.weight().width, + width: self.primitive(ends.1).weight().circle.r * 2.0, }) } }