From 2b835ec3a49a558c43d1922bde7ec8319626065d Mon Sep 17 00:00:00 2001 From: jan Date: Thu, 20 Nov 2025 12:59:20 -0800 Subject: [PATCH] [Port] mirror() should not mirror port position, only orientation --- masque/pattern.py | 11 ++++++----- masque/ports.py | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/masque/pattern.py b/masque/pattern.py index 4a401b6..d870a43 100644 --- a/masque/pattern.py +++ b/masque/pattern.py @@ -1169,12 +1169,13 @@ class Pattern(PortList, AnnotatableImpl, Mirrorable): ports[new_name] = port for name, port in ports.items(): - p = port.deepcopy() + pp = port.deepcopy() if mirrored: - p.mirror() - p.rotate_around(pivot, rotation) - p.translate(offset) - self.ports[name] = p + pp.mirror() + pp.offset[1] *= -1 + pp.rotate_around(pivot, rotation) + pp.translate(offset) + self.ports[name] = pp if append: if isinstance(other, Abstract): diff --git a/masque/ports.py b/masque/ports.py index b8137c0..0211723 100644 --- a/masque/ports.py +++ b/masque/ports.py @@ -100,7 +100,6 @@ class Port(PositionableImpl, Rotatable, PivotableImpl, Copyable, Mirrorable): return self def mirror(self, axis: int = 0) -> Self: - self.offset[1 - axis] *= -1 if self.rotation is not None: self.rotation *= -1 self.rotation += axis * pi