mirror of https://codeberg.org/topola/topola.git
router: don't assume start dot to have a net
This commit is contained in:
parent
499564e6cf
commit
af9cbeba61
|
|
@ -101,13 +101,13 @@ impl Navmesh {
|
||||||
.resize(layout.drawing().geometry().graph().node_bound(), None);
|
.resize(layout.drawing().geometry().graph().node_bound(), None);
|
||||||
|
|
||||||
let layer = layout.drawing().primitive(from).layer();
|
let layer = layout.drawing().primitive(from).layer();
|
||||||
let net = layout.drawing().primitive(from).maybe_net().unwrap();
|
let maybe_net = layout.drawing().primitive(from).maybe_net();
|
||||||
|
|
||||||
for node in layout.drawing().layer_primitive_nodes(layer) {
|
for node in layout.drawing().layer_primitive_nodes(layer) {
|
||||||
let primitive = node.primitive(layout.drawing());
|
let primitive = node.primitive(layout.drawing());
|
||||||
|
|
||||||
if let Some(primitive_net) = primitive.maybe_net() {
|
if let Some(primitive_net) = primitive.maybe_net() {
|
||||||
if node == from.into() || node == to.into() || primitive_net != net {
|
if node == from.into() || node == to.into() || Some(primitive_net) != maybe_net {
|
||||||
match node {
|
match node {
|
||||||
PrimitiveIndex::FixedDot(dot) => {
|
PrimitiveIndex::FixedDot(dot) => {
|
||||||
this.triangulation.add_vertex(TriangulationVertexWeight {
|
this.triangulation.add_vertex(TriangulationVertexWeight {
|
||||||
|
|
@ -147,7 +147,7 @@ impl Navmesh {
|
||||||
Ok(this)
|
Ok(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn triangulation_vertex(&self, vertex: VertexIndex) -> TriangulationVertexIndex {
|
fn triangulation_vertex(&self, vertex: VertexIndex) -> TriangulationVertexIndex {
|
||||||
match vertex {
|
match vertex {
|
||||||
VertexIndex::FixedDot(dot) => TriangulationVertexIndex::FixedDot(dot),
|
VertexIndex::FixedDot(dot) => TriangulationVertexIndex::FixedDot(dot),
|
||||||
VertexIndex::FixedBend(bend) => TriangulationVertexIndex::FixedBend(bend),
|
VertexIndex::FixedBend(bend) => TriangulationVertexIndex::FixedBend(bend),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue