From e4194d0925cefcbcf80dccaf9a29b07140556f67 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sat, 18 May 2024 16:45:09 +0200 Subject: [PATCH] added horizontal zigzag wires --- src/wire.typ | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wire.typ b/src/wire.typ index ab7e2ff..ae17316 100644 --- a/src/wire.typ +++ b/src/wire.typ @@ -22,7 +22,11 @@ #let get-zigzag-wire(pts, ratio, dir) = { let start = pts.first() let end = pts.last() - let mid = (start, ratio, end) + let mid = if dir == "vertical" { + (start, ratio, (horizontal: end, vertical: ())) + } else { + (start, ratio, (horizontal: (), vertical: end)) + } let points = if dir == "vertical" { ( @@ -235,8 +239,7 @@ } if slice != none { - let (start, end) = slice - let slice-txt = "[" + str(start) + ":" + str(end) + "]" + let slice-txt = "[" + slice.map(b => str(b)).join(":") + "]" draw.content( first-pt,