react-chessboard-ui 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChessBoard/utils.d.ts +5 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +4 -1
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -49,3 +49,8 @@ export declare const getChessBoardConfig: (config: Partial<ChessBoardConfig> | u
|
|
|
49
49
|
* @param forPawnTransform только фигуры для превращения пешки
|
|
50
50
|
*/
|
|
51
51
|
export declare const getFiguresByColor: (color: FigureColor, forPawnTransform?: boolean) => Figure[];
|
|
52
|
+
/**
|
|
53
|
+
* Корректирует позицию захвата курсором
|
|
54
|
+
* коррекция происходит по сроллу
|
|
55
|
+
*/
|
|
56
|
+
export declare const correctGrabbingPosByScroll: (pos: CellPos) => CellPos;
|
package/dist/index.js
CHANGED
|
@@ -1960,6 +1960,9 @@ var getFiguresByColor = function getFiguresByColor(color, forPawnTransform) {
|
|
|
1960
1960
|
};
|
|
1961
1961
|
});
|
|
1962
1962
|
};
|
|
1963
|
+
var correctGrabbingPosByScroll = function correctGrabbingPosByScroll(pos) {
|
|
1964
|
+
return [pos[0] - window.scrollX, pos[1] - window.scrollY];
|
|
1965
|
+
};
|
|
1963
1966
|
|
|
1964
1967
|
var BASE_BOARD_SIZE = 8;
|
|
1965
1968
|
var ChessBoardCellsLayout = function ChessBoardCellsLayout(_ref) {
|
|
@@ -2788,7 +2791,7 @@ var ChessBoard = function ChessBoard(props) {
|
|
|
2788
2791
|
selectedPos: fromPos,
|
|
2789
2792
|
possibleMoves: possibleMoves,
|
|
2790
2793
|
holdedFigure: holdedFigure,
|
|
2791
|
-
grabbingPos: grabbingPos,
|
|
2794
|
+
grabbingPos: correctGrabbingPosByScroll(grabbingPos),
|
|
2792
2795
|
markedCells: markedCells,
|
|
2793
2796
|
boardConfig: boardConfig,
|
|
2794
2797
|
onHasCheck: getHasCheckByCellPos
|