diff --git a/src/layout/layout.rs b/src/layout/layout.rs index 521d84a..a269392 100644 --- a/src/layout/layout.rs +++ b/src/layout/layout.rs @@ -389,12 +389,23 @@ impl Layout { .compounds(GenericIndex::<()>::new(primitive.index())) .find_map(|(_, compound)| { if let CompoundWeight::Poly(_) = self.drawing().compound_weight(compound) { - Some(compound) + Some(GenericIndex::::new(compound.index())) + } else { + None + } + }) + } + + pub fn fixed_dot_via(&self, dot: FixedDotIndex) -> Option> { + self.drawing() + .compounds(GenericIndex::<()>::new(dot.index())) + .find_map(|(_, compound)| { + if let CompoundWeight::Via(_) = self.drawing().compound_weight(compound) { + Some(GenericIndex::::new(compound.index())) } else { None } }) - .map(|compound| GenericIndex::::new(compound.index())) } /// Checks if a node is not a primitive part of a compound, and if yes, returns its apex and center