source: imaps-frontend/node_modules/react-tiles-dnd/esm/tile-layout/table-utils/tiles.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.2 KB
Line 
1import 'tslib';
2
3var getTileTouchPoint = function (draggingTile, targetTile, absolutePosition, _a) {
4 var elementHeight = _a.elementHeight, elementWidth = _a.elementWidth, activeBorderSize = _a.activeBorderSize;
5 var position = {
6 x: absolutePosition.x - targetTile.col * elementWidth,
7 y: absolutePosition.y - targetTile.row * elementHeight,
8 };
9 if (draggingTile.col >= targetTile.col && position.x < activeBorderSize)
10 return 'left';
11 if (draggingTile.col <= targetTile.col &&
12 position.x > elementWidth * targetTile.colSpan - activeBorderSize)
13 return 'right';
14 if (draggingTile.row <= targetTile.row &&
15 position.y > elementHeight * targetTile.rowSpan - activeBorderSize)
16 return 'bottom';
17 if (draggingTile.row >= targetTile.row && position.y < activeBorderSize)
18 return 'top';
19 if (position.x > activeBorderSize &&
20 position.y < elementWidth * targetTile.colSpan - activeBorderSize &&
21 position.y > activeBorderSize &&
22 position.y < elementHeight * targetTile.rowSpan - activeBorderSize)
23 return 'center';
24};
25
26export { getTileTouchPoint };
27//# sourceMappingURL=tiles.js.map
Note: See TracBrowser for help on using the repository browser.