From 2317fec71dde4f88b867d96ac4328f0b5acee982 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sat, 18 May 2024 18:08:22 +0200 Subject: [PATCH] fixed wire name rotation --- src/wire.typ | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wire.typ b/src/wire.typ index ae17316..5e8cd40 100644 --- a/src/wire.typ +++ b/src/wire.typ @@ -192,15 +192,18 @@ let second-pos = points.at(1) if reverse { (first-pt, last-pt) = (last-pt, first-pt) - (first-pos, second-pos) = (second-pos, first-pos) } let angle = 0deg if rotate-name { (ctx, first-pos) = coordinate.resolve(ctx, first-pos) (ctx, second-pos) = coordinate.resolve(ctx, second-pos) - let (x1, y1, _) = first-pos - let (x2, y2, _) = second-pos + + if reverse { + (first-pos, second-pos) = (second-pos, first-pos) + } + let (x1, y1, ..) = first-pos + let (x2, y2, ..) = second-pos angle = calc.atan2(x2 - x1, y2 - y1) }