Skip to content

Commit

Permalink
fix a rendering bug due to wrong rotation and flip order
Browse files Browse the repository at this point in the history
  • Loading branch information
mwinkens committed Jun 6, 2024
1 parent 88e6adf commit fef529b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/widgets/widget_base_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ def paintEvent(self, e: Any, _: Any = None) -> None:

if self.tile_data:
transform.translate(pm.width() // 2, pm.height() // 2)

# rotate first, because otherwise you might rotate your flip breaking this in the process
if self.tile_data.status.rot:
transform.rotate(90) # fixed 90 degrees always, but can also flip, too!

if self.tile_data.status.h_flip:
transform = transform.scale(1, -1)

if self.tile_data.status.v_flip:
transform = transform.scale(-1, 1)

if self.tile_data.status.rot:
transform.rotate(90) # fixed 90 degrees always, but can also flip, too!
transform.translate(-pm.width() // 2, -pm.height() // 2)

# draw tile
Expand Down

0 comments on commit fef529b

Please sign in to comment.