Add persisted per-view port anchors and connection-aware border placement
Rust checks / check (ubuntu-latest) (push) Canceled after 0s
Rust checks / check (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-09-06 01:18:51 +03:00
parent 4e8575bd11
commit 5b08d8016b
13 changed files with 1435 additions and 149 deletions
+34
View File
@@ -731,6 +731,40 @@ pub fn validate(p: &Project) -> Vec<Issue> {
}
let mut elements = BTreeSet::new();
for (key, n) in &d.nodes {
let mut ports = BTreeSet::new();
for anchor in &n.port_anchors {
if !ports.insert(anchor.port) {
error(
&mut out,
n.id,
"duplicate_port_anchor",
"port_anchors",
"Each port has at most one manual anchor per owner placement.",
);
}
if !p
.elements
.get(&anchor.port)
.is_some_and(|e| e.kind() == Kind::Port && e.parent == Some(n.element))
{
error(
&mut out,
n.id,
"port_anchor_owner",
"port_anchors",
"A manual anchor must reference a direct child port of its owner placement; repair anchors in the same transaction when reparenting.",
);
}
if !anchor.offset.is_finite() || !(0. ..=1.).contains(&anchor.offset) {
error(
&mut out,
n.id,
"invalid_port_offset",
"port_anchors",
"Port offset must be finite and between zero and one.",
);
}
}
if *key != n.id {
error(
&mut out,