Prefer [1 - axis] for clarity

This commit is contained in:
Jan Petykiewicz 2026-02-14 19:20:50 -08:00
commit accad3db9f
5 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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':

View file

@ -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:

View file

@ -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':