Add persisted per-view port anchors and connection-aware border placement
This commit is contained in:
@@ -187,6 +187,11 @@ pub fn remap_references(p: &mut Project, old: Id, new: Id) {
|
||||
}
|
||||
}
|
||||
for n in d.nodes.values_mut() {
|
||||
for anchor in &mut n.port_anchors {
|
||||
if anchor.port == old {
|
||||
anchor.port = new;
|
||||
}
|
||||
}
|
||||
if n.element == old {
|
||||
n.element = new;
|
||||
}
|
||||
@@ -345,6 +350,10 @@ fn remove_objects(p: &mut Project, removed: BTreeSet<Id>) {
|
||||
for d in p.diagrams.values_mut() {
|
||||
d.nodes.retain(|id, _| !removed.contains(id));
|
||||
d.routes.retain(|route| !removed.contains(&route.edge));
|
||||
for node in d.nodes.values_mut() {
|
||||
node.port_anchors
|
||||
.retain(|anchor| !removed.contains(&anchor.port));
|
||||
}
|
||||
}
|
||||
let clear = |v: &mut Option<Id>| {
|
||||
if v.is_some_and(|id| removed.contains(&id)) {
|
||||
|
||||
Reference in New Issue
Block a user