diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-06-10 19:30:33 -0700 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-06-10 19:30:33 -0700 |
commit | 8f722fde7222d5a664753723b6fbc8bc69dadb06 (patch) | |
tree | 8cbbd62645decb93e087d3476718bea56a99a9e0 | |
parent | f4edbce0eb2d1cddc2c921b12d65292cb3886455 (diff) | |
download | chessh-8f722fde7222d5a664753723b6fbc8bc69dadb06.tar.gz chessh-8f722fde7222d5a664753723b6fbc8bc69dadb06.zip |
Use flip
-rw-r--r-- | lib/chessh/ssh/client/game/renderer.ex | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/chessh/ssh/client/game/renderer.ex b/lib/chessh/ssh/client/game/renderer.ex index ecd1803..676c7bd 100644 --- a/lib/chessh/ssh/client/game/renderer.ex +++ b/lib/chessh/ssh/client/game/renderer.ex @@ -178,9 +178,7 @@ defmodule Chessh.SSH.Client.Game.Renderer do curr_x = div(col, tile_width) col_relative_to_tile = col - curr_x * tile_width - board_coord = - {if(!flipped, do: curr_y, else: @chess_board_height - curr_y - 1), - if(!flipped, do: curr_x, else: @chess_board_width - curr_x - 1)} + board_coord = if flipped, do: flip({curr_y, curr_x}), else: {curr_y, curr_x} {color, char} = case Map.fetch(board_coord_to_piece_art, board_coord) do |