diff --git a/masque/shapes/path.py b/masque/shapes/path.py index db7831a..b618001 100644 --- a/masque/shapes/path.py +++ b/masque/shapes/path.py @@ -314,7 +314,8 @@ class Path(Shape): return bounds def rotate(self, theta: float) -> 'Path': - self.vertices = numpy.dot(rotation_matrix_2d(theta), self.vertices.T).T + if theta != 0: + self.vertices = numpy.dot(rotation_matrix_2d(theta), self.vertices.T).T return self def mirror(self, axis: int) -> 'Path': diff --git a/masque/shapes/polygon.py b/masque/shapes/polygon.py index 71c9491..97cc66c 100644 --- a/masque/shapes/polygon.py +++ b/masque/shapes/polygon.py @@ -262,7 +262,8 @@ class Polygon(Shape): self.offset + numpy.max(self.vertices, axis=0))) def rotate(self, theta: float) -> 'Polygon': - self.vertices = numpy.dot(rotation_matrix_2d(theta), self.vertices.T).T + if theta != 0: + self.vertices = numpy.dot(rotation_matrix_2d(theta), self.vertices.T).T return self def mirror(self, axis: int) -> 'Polygon':