Prefer [1 - axis] for clarity
This commit is contained in:
parent
05098c0c13
commit
accad3db9f
5 changed files with 5 additions and 5 deletions
|
|
@ -384,7 +384,7 @@ class Arc(PositionableImpl, Shape):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def mirror(self, axis: int = 0) -> 'Arc':
|
def mirror(self, axis: int = 0) -> 'Arc':
|
||||||
self.offset[axis - 1] *= -1
|
self.offset[1 - axis] *= -1
|
||||||
self.rotation *= -1
|
self.rotation *= -1
|
||||||
self.rotation += axis * pi
|
self.rotation += axis * pi
|
||||||
self.angles *= -1
|
self.angles *= -1
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ class Ellipse(PositionableImpl, Shape):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def mirror(self, axis: int = 0) -> Self:
|
def mirror(self, axis: int = 0) -> Self:
|
||||||
self.offset[axis - 1] *= -1
|
self.offset[1 - axis] *= -1
|
||||||
self.rotation *= -1
|
self.rotation *= -1
|
||||||
self.rotation += axis * pi
|
self.rotation += axis * pi
|
||||||
return self
|
return self
|
||||||
|
|
|
||||||
|
|
@ -396,7 +396,7 @@ class Path(Shape):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def mirror(self, axis: int = 0) -> 'Path':
|
def mirror(self, axis: int = 0) -> 'Path':
|
||||||
self.vertices[:, axis - 1] *= -1
|
self.vertices[:, 1 - axis] *= -1
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def scale_by(self, c: float) -> 'Path':
|
def scale_by(self, c: float) -> 'Path':
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ class PolyCollection(Shape):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def mirror(self, axis: int = 0) -> Self:
|
def mirror(self, axis: int = 0) -> Self:
|
||||||
self._vertex_lists[:, axis - 1] *= -1
|
self._vertex_lists[:, 1 - axis] *= -1
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def scale_by(self, c: float) -> Self:
|
def scale_by(self, c: float) -> Self:
|
||||||
|
|
|
||||||
|
|
@ -394,7 +394,7 @@ class Polygon(Shape):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def mirror(self, axis: int = 0) -> 'Polygon':
|
def mirror(self, axis: int = 0) -> 'Polygon':
|
||||||
self.vertices[:, axis - 1] *= -1
|
self.vertices[:, 1 - axis] *= -1
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def scale_by(self, c: float) -> 'Polygon':
|
def scale_by(self, c: float) -> 'Polygon':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue