From 08f931bbde7838b9e196f713148f7b29a6cd888a Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sat, 18 May 2024 16:46:32 +0200 Subject: [PATCH] added small clock ports --- src/elements/ports.typ | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/elements/ports.typ b/src/elements/ports.typ index 51bf409..92d667a 100644 --- a/src/elements/ports.typ +++ b/src/elements/ports.typ @@ -15,11 +15,12 @@ panic("Clock port must have previous and next positions") } + let size = if port.at("small", default: false) {8pt} else {1em} let offset - if (side == "north") { offset = ( 0, -1em) } - else if (side == "east") { offset = (-1em, 0) } - else if (side == "south") { offset = ( 0, 1em) } - else if (side == "west") { offset = ( 1em, 0) } + if (side == "north") { offset = ( 0, -size) } + else if (side == "east") { offset = (-size, 0) } + else if (side == "south") { offset = ( 0, size) } + else if (side == "west") { offset = ( size, 0) } let pos1 = (rel: offset, to: pos) @@ -96,6 +97,11 @@ let pos-prev = (pt0, pct-prev, pt1) let pos-next = (pt0, pct-next, pt1) + if port.at("small", default: false) { + pos-prev = (pos, 4pt, pt0) + pos-next = (pos, 4pt, pt1) + } + add-port( elmt-id, side,