diff --git a/masque/pattern.py b/masque/pattern.py index f4fb649..6b2de99 100644 --- a/masque/pattern.py +++ b/masque/pattern.py @@ -793,18 +793,22 @@ class Pattern(PortList, AnnotatableImpl, Mirrorable): cast('Rotatable', entry).rotate(rotation) return self - def mirror_elements(self, across_axis: int = 0) -> Self: + def mirror_elements(self, axis: int = 0) -> Self: """ - Mirror each shape, ref, and port relative to (0,0). + Mirror each shape, ref, and port relative to its offset. Args: - across_axis: Axis to mirror across - (0: mirror across x axis, 1: mirror across y axis) + axis: Axis to mirror across + 0: mirror across x axis (flip y), + 1: mirror across y axis (flip x) Returns: self """ - return self.flip_across(axis=across_axis) + for entry in chain(chain_elements(self.shapes, self.refs), self.ports.values()): + cast('Mirrorable', entry).mirror(axis=axis) + self._log_bulk_update(f"mirror_elements({axis})") + return self def mirror(self, axis: int = 0) -> Self: """