From 4e125ef40cd63b867b0f3e7dbade2d006558d1ea Mon Sep 17 00:00:00 2001 From: nafkhanzam Date: Sat, 5 Oct 2024 00:18:25 +0700 Subject: [PATCH] change y logic to relative --- src/elements/logic/gate.typ | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/elements/logic/gate.typ b/src/elements/logic/gate.typ index ebf6115..6aa07ac 100644 --- a/src/elements/logic/gate.typ +++ b/src/elements/logic/gate.typ @@ -54,20 +54,24 @@ let (ctx, to-pos) = coordinate.resolve(ctx, (rel: (offset, 0), to: to)) x = to-pos.at(0) } - + if (type(y) == dictionary) { - let from = y.from + let offset = y.rel let to = y.to - - let dy - if to == "out" { - dy = height / 2 - } else { - dy = height * (i + 0.5) / inputs - } - - let (ctx, from-pos) = coordinate.resolve(ctx, from) - y = from-pos.at(1) + dy - height + let (ctx, to-pos) = coordinate.resolve(ctx, (rel: (0, offset), to: to)) + y = to-pos.at(1) + // let from = y.from + // let to = y.to + + // let dy + // if to == "out" { + // dy = height / 2 + // } else { + // dy = height * (i + 0.5) / inputs + // } + + // let (ctx, from-pos) = coordinate.resolve(ctx, from) + // y = from-pos.at(1) + dy - height } let tl = (x, y + height)