Skip to content

Commit

Permalink
Merge pull request #905 from Mauritz8/fix-archived-game-screen-flip-b…
Browse files Browse the repository at this point in the history
…oard

fix: flip players on flip board action in archived game screen
  • Loading branch information
veloce authored Sep 2, 2024
2 parents 7dcd9d7 + 1bccb7a commit 8f709c1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/src/view/game/archived_game_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,11 @@ class _BoardBody extends ConsumerWidget {
: null,
materialDiff: game.materialDiffAt(cursor, Side.white),
);
final topPlayer = orientation == Side.white ? black : white;
final bottomPlayer = orientation == Side.white ? white : black;

final topPlayerIsBlack = orientation == Side.white && !isBoardTurned ||
orientation == Side.black && isBoardTurned;
final topPlayer = topPlayerIsBlack ? black : white;
final bottomPlayer = topPlayerIsBlack ? white : black;

final position = game.positionAt(cursor);

Expand Down

0 comments on commit 8f709c1

Please sign in to comment.