feat: Add anchor-based zigzag bend placement via zigzag-at
Introduce a new `zigzag-at` parameter on `wire.wire` as an alternative
to `zigzag-ratio` for positioning the middle bend segment of a
`style: "zigzag"` wire. Instead of a fraction of the endpoint span,
the bend is placed on the axis of a referenced anchor via CeTZ's
perpendicular operator (`|-`):
- zigzag-dir "vertical": segment sits at anchor.x
- zigzag-dir "horizontal": segment sits at anchor.y
Accepted forms:
- str — raw CeTZ anchor name (e.g. port anchor
"elmt-port-id" or "elmt.center")
- array / native CeTZ dict — used as-is
- (rel: <length>, to: <coord>) with scalar rel — ergonomic axial
offset, rewritten to (rel: (dx, 0), to: ...) for vertical dir or
(rel: (0, dy), to: ...) for horizontal dir
`zigzag-ratio` default flipped from `50%` to `auto` (still resolves
to 50%) to allow detecting an explicit user override. Panics on
misuse:
- `zigzag-at` set together with an explicit `zigzag-ratio`
- `zigzag-at` set with a non-zigzag `style`
Add `examples.zigzag-at` demonstrating both the string-anchor and the
ergonomic offset forms.
This commit is contained in:
1 parent
fff5b2ecd5
commit
72eab1620c
3 files changed
+8015
-7666
No files matched your search
+7901
-7644
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user