Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Assets/Scripts/UI/BoardUI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections;
using System;
using System.Collections;
using UnityEngine;

namespace Chess.Game {
Expand Down Expand Up @@ -58,8 +59,8 @@ public void DeselectSquare (Coord coord) {
}

public bool TryGetSquareUnderMouse (Vector2 mouseWorld, out Coord selectedCoord) {
int file = (int) (mouseWorld.x + 4);
int rank = (int) (mouseWorld.y + 4);
int file = (int)Math.Floor(mouseWorld.x + 4);
int rank = (int)Math.Floor(mouseWorld.y + 4);
if (!whiteIsBottom) {
file = 7 - file;
rank = 7 - rank;
Expand Down