From accad3db9fbefe54d3211e1c3467eabb34de88e2 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sat, 14 Feb 2026 19:20:50 -0800 Subject: [PATCH] Prefer [1 - axis] for clarity --- masque/shapes/arc.py | 2 +- masque/shapes/ellipse.py | 2 +- masque/shapes/path.py | 2 +- masque/shapes/poly_collection.py | 2 +- masque/shapes/polygon.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/masque/shapes/arc.py b/masque/shapes/arc.py index 480835e..79411d6 100644 --- a/masque/shapes/arc.py +++ b/masque/shapes/arc.py @@ -384,7 +384,7 @@ class Arc(PositionableImpl, Shape): return self def mirror(self, axis: int = 0) -> 'Arc': - self.offset[axis - 1] *= -1 + self.offset[1 - axis] *= -1 self.rotation *= -1 self.rotation += axis * pi self.angles *= -1 diff --git a/masque/shapes/ellipse.py b/masque/shapes/ellipse.py index 6029f2f..6699e53 100644 --- a/masque/shapes/ellipse.py +++ b/masque/shapes/ellipse.py @@ -189,7 +189,7 @@ class Ellipse(PositionableImpl, Shape): return self def mirror(self, axis: int = 0) -> Self: - self.offset[axis - 1] *= -1 + self.offset[1 - axis] *= -1 self.rotation *= -1 self.rotation += axis * pi return self diff --git a/masque/shapes/path.py b/masque/shapes/path.py index 7778428..654cfaa 100644 --- a/masque/shapes/path.py +++ b/masque/shapes/path.py @@ -396,7 +396,7 @@ class Path(Shape): return self def mirror(self, axis: int = 0) -> 'Path': - self.vertices[:, axis - 1] *= -1 + self.vertices[:, 1 - axis] *= -1 return self def scale_by(self, c: float) -> 'Path': diff --git a/masque/shapes/poly_collection.py b/masque/shapes/poly_collection.py index 6048f24..afa9c99 100644 --- a/masque/shapes/poly_collection.py +++ b/masque/shapes/poly_collection.py @@ -179,7 +179,7 @@ class PolyCollection(Shape): return self def mirror(self, axis: int = 0) -> Self: - self._vertex_lists[:, axis - 1] *= -1 + self._vertex_lists[:, 1 - axis] *= -1 return self def scale_by(self, c: float) -> Self: diff --git a/masque/shapes/polygon.py b/masque/shapes/polygon.py index c8c3ddd..6440144 100644 --- a/masque/shapes/polygon.py +++ b/masque/shapes/polygon.py @@ -394,7 +394,7 @@ class Polygon(Shape): return self def mirror(self, axis: int = 0) -> 'Polygon': - self.vertices[:, axis - 1] *= -1 + self.vertices[:, 1 - axis] *= -1 return self def scale_by(self, c: float) -> 'Polygon':