mirror of https://codeberg.org/topola/topola.git
egui: fix selection of polys and vias
This commit is contained in:
parent
ca27804c64
commit
61babd179a
|
|
@ -53,12 +53,30 @@ impl Overlay {
|
||||||
))
|
))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if let Some(geom) = geoms.iter().find(|&&geom| match geom.data {
|
if let Some(geom) = geoms.iter().find(|&&geom| {
|
||||||
NodeIndex::Primitive(primitive) => {
|
self.contains_point(board, geom.data, at)
|
||||||
primitive.primitive(board.layout().drawing()).layer() == self.active_layer
|
&& match geom.data {
|
||||||
&& self.contains_point(board, geom.data, at)
|
NodeIndex::Primitive(primitive) => {
|
||||||
}
|
primitive.primitive(board.layout().drawing()).layer() == self.active_layer
|
||||||
NodeIndex::Compound(compound) => false,
|
}
|
||||||
|
NodeIndex::Compound(compound) => {
|
||||||
|
match board.layout().drawing().compound_weight(compound) {
|
||||||
|
CompoundWeight::Poly(weight) => {
|
||||||
|
board
|
||||||
|
.layout()
|
||||||
|
.poly(GenericIndex::<PolyWeight>::new(
|
||||||
|
compound.petgraph_index(),
|
||||||
|
))
|
||||||
|
.layer()
|
||||||
|
== self.active_layer
|
||||||
|
}
|
||||||
|
CompoundWeight::Via(weight) => {
|
||||||
|
weight.from_layer >= self.active_layer
|
||||||
|
&& weight.to_layer <= self.active_layer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}) {
|
}) {
|
||||||
self.selection.toggle_at_node(board, geom.data);
|
self.selection.toggle_at_node(board, geom.data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue