mirror of https://codeberg.org/topola/topola.git
fix(layout): nitpicks
This commit is contained in:
parent
d1be9e753e
commit
82a4ba4724
|
|
@ -149,7 +149,7 @@ impl SegShape {
|
||||||
polygon![p1.0, p2.0, p3.0, p4.0]
|
polygon![p1.0, p2.0, p3.0, p4.0]
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn middle_line(&self) -> Line {
|
pub fn middle_line(&self) -> Line {
|
||||||
Line {
|
Line {
|
||||||
start: self.from.into(),
|
start: self.from.into(),
|
||||||
end: self.to.into(),
|
end: self.to.into(),
|
||||||
|
|
|
||||||
|
|
@ -363,7 +363,7 @@ impl<R: AccessRules> Layout<R> {
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NodeIndex::Compound(cwidx) => Some(self.node_shape(node).center()),
|
NodeIndex::Compound(_) => Some(self.node_shape(node).center()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -416,9 +416,9 @@ impl<R: AccessRules> Layout<R> {
|
||||||
.map(|loose| {
|
.map(|loose| {
|
||||||
let prim: PrimitiveIndex = loose.into();
|
let prim: PrimitiveIndex = loose.into();
|
||||||
let shape = prim.primitive(&self.drawing).shape();
|
let shape = prim.primitive(&self.drawing).shape();
|
||||||
(prim, loose, shape)
|
(loose, shape)
|
||||||
})
|
})
|
||||||
.filter_map(|(prim, loose, shape)| {
|
.filter_map(|(loose, shape)| {
|
||||||
let band_uid = self.drawing.loose_band_uid(loose);
|
let band_uid = self.drawing.loose_band_uid(loose);
|
||||||
let loose_hline = orig_hline.orthogonal_through(&match shape {
|
let loose_hline = orig_hline.orthogonal_through(&match shape {
|
||||||
PrimitiveShape::Seg(seg) => {
|
PrimitiveShape::Seg(seg) => {
|
||||||
|
|
@ -443,11 +443,9 @@ impl<R: AccessRules> Layout<R> {
|
||||||
shape,
|
shape,
|
||||||
location
|
location
|
||||||
);
|
);
|
||||||
if 0.0 <= location && location <= 1.0 {
|
(0.0..=1.0)
|
||||||
Some((location, band_uid))
|
.contains(&location)
|
||||||
} else {
|
.then_some((location, band_uid))
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
bands.sort_by(|a, b| f64::total_cmp(&a.0, &b.0));
|
bands.sort_by(|a, b| f64::total_cmp(&a.0, &b.0));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue