Skip to content

Commit

Permalink
fix mirroring for rotated ports/devices
Browse files Browse the repository at this point in the history
  • Loading branch information
anewusername committed Dec 5, 2020
1 parent b7383a3 commit 479e0c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions masque/builder/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def set_ptype(self: P, ptype: int) -> P:
def mirror(self: P, axis: int) -> P:
self.offset[1 - axis] *= -1
if self.rotation is not None:
self.rotation += pi
self.rotation *= -1
self.rotation += axis * pi
return self

def rotate(self: P, rotation: float) -> P:
Expand Down Expand Up @@ -606,9 +607,10 @@ def find_transform(self: D,

if mirrored[0]:
o_offsets[:, 1] *= -1
o_rotations += pi
o_rotations *= -1
if mirrored[1]:
o_offsets[:, 0] *= -1
o_rotations *= -1
o_rotations += pi

type_conflicts = (s_types != o_types) & (s_types != 0) & (o_types != 0)
Expand Down

0 comments on commit 479e0c3

Please sign in to comment.