internal PosXY GetPositionXY(int x, int y) { var result = new PosXY(); if ((x >= 0) && (y >= 0) && (x < boardDimX * boardBoxDim) && (y < boardDimY * boardBoxDim)) { result.PosX = x / boardBoxDim; result.PosY = y / boardBoxDim; } return(result); }
internal void RefreshInfoPaneXY(MouseEventArgs e, ref PosXY CurrentPositionXY) { var TempPositionXY = new PosXY(); //to fix at very beginning TempPositionXY = GetPositionXY(e.X, e.Y); if (CurrentPositionXY != TempPositionXY) { if ((TempPositionXY.PosX != GlobalParameters.OutOfRange) && (TempPositionXY.PosY != GlobalParameters.OutOfRange)) { CurrentPositionXY = TempPositionXY; } } }