mirror of https://codeberg.org/topola/topola.git
graph: Remove width from loose seg weights, add it to fixed bend weights
This commit is contained in:
parent
3619c5eab4
commit
fae2ada334
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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<Weight> + Copy {}
|
|||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub struct FixedBendWeight {
|
||||
pub net: i64,
|
||||
pub width: f64,
|
||||
pub cw: bool,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue