microboard-temp 0.5.101 → 0.5.102
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/cjs/browser.js +11 -11
- package/dist/cjs/index.js +11 -11
- package/dist/cjs/node.js +11 -11
- package/dist/esm/browser.js +11 -11
- package/dist/esm/index.js +11 -11
- package/dist/esm/node.js +11 -11
- package/dist/types/Settings.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -7073,7 +7073,8 @@ var conf = {
|
|
|
7073
7073
|
DECK_VERTICAL_OFFSET: 2,
|
|
7074
7074
|
CARD_DIMENSIONS: { width: 250, height: 400 },
|
|
7075
7075
|
DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 },
|
|
7076
|
-
MAX_CARD_SIZE: 500
|
|
7076
|
+
MAX_CARD_SIZE: 500,
|
|
7077
|
+
CONNECTOR_ITEM_OFFSET: 20
|
|
7077
7078
|
};
|
|
7078
7079
|
initDefaultI18N();
|
|
7079
7080
|
|
|
@@ -36669,7 +36670,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
36669
36670
|
}
|
|
36670
36671
|
|
|
36671
36672
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
36672
|
-
var ITEM_OFFSET = 1;
|
|
36673
36673
|
function getDirection(from, to) {
|
|
36674
36674
|
if (!to) {
|
|
36675
36675
|
return null;
|
|
@@ -36716,7 +36716,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
36716
36716
|
for (const pos of potentialNeighbors) {
|
|
36717
36717
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0 && grid[pos.x] && grid[pos.x][pos.y]) {
|
|
36718
36718
|
const newPoint = grid[pos.x][pos.y];
|
|
36719
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
36719
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
36720
36720
|
neighbors.push({
|
|
36721
36721
|
point: newPoint,
|
|
36722
36722
|
costSoFar: 0,
|
|
@@ -36736,22 +36736,22 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36736
36736
|
const endDir = getPointerDirection(end);
|
|
36737
36737
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36738
36738
|
const offsetMap = {
|
|
36739
|
-
top: { x: 0, y: -
|
|
36740
|
-
bottom: { x: 0, y:
|
|
36741
|
-
right: { x:
|
|
36742
|
-
left: { x: -
|
|
36739
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
36740
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
36741
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
36742
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
36743
36743
|
};
|
|
36744
36744
|
const horizontalLines = [];
|
|
36745
36745
|
const verticalLines = [];
|
|
36746
36746
|
if (start.pointType !== "Board") {
|
|
36747
36747
|
const itemMbr = start.item.getMbr();
|
|
36748
|
-
verticalLines.push(itemMbr.left -
|
|
36749
|
-
horizontalLines.push(itemMbr.top -
|
|
36748
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36749
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36750
36750
|
}
|
|
36751
36751
|
if (end.pointType !== "Board") {
|
|
36752
36752
|
const itemMbr = end.item.getMbr();
|
|
36753
|
-
verticalLines.push(itemMbr.left -
|
|
36754
|
-
horizontalLines.push(itemMbr.top -
|
|
36753
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36754
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36755
36755
|
}
|
|
36756
36756
|
const tempStart = start;
|
|
36757
36757
|
const tempEnd = end;
|
package/dist/cjs/index.js
CHANGED
|
@@ -7073,7 +7073,8 @@ var conf = {
|
|
|
7073
7073
|
DECK_VERTICAL_OFFSET: 2,
|
|
7074
7074
|
CARD_DIMENSIONS: { width: 250, height: 400 },
|
|
7075
7075
|
DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 },
|
|
7076
|
-
MAX_CARD_SIZE: 500
|
|
7076
|
+
MAX_CARD_SIZE: 500,
|
|
7077
|
+
CONNECTOR_ITEM_OFFSET: 20
|
|
7077
7078
|
};
|
|
7078
7079
|
initDefaultI18N();
|
|
7079
7080
|
|
|
@@ -36669,7 +36670,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
36669
36670
|
}
|
|
36670
36671
|
|
|
36671
36672
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
36672
|
-
var ITEM_OFFSET = 1;
|
|
36673
36673
|
function getDirection(from, to) {
|
|
36674
36674
|
if (!to) {
|
|
36675
36675
|
return null;
|
|
@@ -36716,7 +36716,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
36716
36716
|
for (const pos of potentialNeighbors) {
|
|
36717
36717
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0 && grid[pos.x] && grid[pos.x][pos.y]) {
|
|
36718
36718
|
const newPoint = grid[pos.x][pos.y];
|
|
36719
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
36719
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
36720
36720
|
neighbors.push({
|
|
36721
36721
|
point: newPoint,
|
|
36722
36722
|
costSoFar: 0,
|
|
@@ -36736,22 +36736,22 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36736
36736
|
const endDir = getPointerDirection(end);
|
|
36737
36737
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36738
36738
|
const offsetMap = {
|
|
36739
|
-
top: { x: 0, y: -
|
|
36740
|
-
bottom: { x: 0, y:
|
|
36741
|
-
right: { x:
|
|
36742
|
-
left: { x: -
|
|
36739
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
36740
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
36741
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
36742
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
36743
36743
|
};
|
|
36744
36744
|
const horizontalLines = [];
|
|
36745
36745
|
const verticalLines = [];
|
|
36746
36746
|
if (start.pointType !== "Board") {
|
|
36747
36747
|
const itemMbr = start.item.getMbr();
|
|
36748
|
-
verticalLines.push(itemMbr.left -
|
|
36749
|
-
horizontalLines.push(itemMbr.top -
|
|
36748
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36749
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36750
36750
|
}
|
|
36751
36751
|
if (end.pointType !== "Board") {
|
|
36752
36752
|
const itemMbr = end.item.getMbr();
|
|
36753
|
-
verticalLines.push(itemMbr.left -
|
|
36754
|
-
horizontalLines.push(itemMbr.top -
|
|
36753
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36754
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36755
36755
|
}
|
|
36756
36756
|
const tempStart = start;
|
|
36757
36757
|
const tempEnd = end;
|
package/dist/cjs/node.js
CHANGED
|
@@ -8110,7 +8110,8 @@ var conf = {
|
|
|
8110
8110
|
DECK_VERTICAL_OFFSET: 2,
|
|
8111
8111
|
CARD_DIMENSIONS: { width: 250, height: 400 },
|
|
8112
8112
|
DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 },
|
|
8113
|
-
MAX_CARD_SIZE: 500
|
|
8113
|
+
MAX_CARD_SIZE: 500,
|
|
8114
|
+
CONNECTOR_ITEM_OFFSET: 20
|
|
8114
8115
|
};
|
|
8115
8116
|
initDefaultI18N();
|
|
8116
8117
|
|
|
@@ -39142,7 +39143,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
39142
39143
|
}
|
|
39143
39144
|
|
|
39144
39145
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
39145
|
-
var ITEM_OFFSET = 1;
|
|
39146
39146
|
function getDirection(from, to) {
|
|
39147
39147
|
if (!to) {
|
|
39148
39148
|
return null;
|
|
@@ -39189,7 +39189,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
39189
39189
|
for (const pos of potentialNeighbors) {
|
|
39190
39190
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0 && grid[pos.x] && grid[pos.x][pos.y]) {
|
|
39191
39191
|
const newPoint = grid[pos.x][pos.y];
|
|
39192
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
39192
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
39193
39193
|
neighbors.push({
|
|
39194
39194
|
point: newPoint,
|
|
39195
39195
|
costSoFar: 0,
|
|
@@ -39209,22 +39209,22 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
39209
39209
|
const endDir = getPointerDirection(end);
|
|
39210
39210
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
39211
39211
|
const offsetMap = {
|
|
39212
|
-
top: { x: 0, y: -
|
|
39213
|
-
bottom: { x: 0, y:
|
|
39214
|
-
right: { x:
|
|
39215
|
-
left: { x: -
|
|
39212
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
39213
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
39214
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
39215
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
39216
39216
|
};
|
|
39217
39217
|
const horizontalLines = [];
|
|
39218
39218
|
const verticalLines = [];
|
|
39219
39219
|
if (start.pointType !== "Board") {
|
|
39220
39220
|
const itemMbr = start.item.getMbr();
|
|
39221
|
-
verticalLines.push(itemMbr.left -
|
|
39222
|
-
horizontalLines.push(itemMbr.top -
|
|
39221
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
39222
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
39223
39223
|
}
|
|
39224
39224
|
if (end.pointType !== "Board") {
|
|
39225
39225
|
const itemMbr = end.item.getMbr();
|
|
39226
|
-
verticalLines.push(itemMbr.left -
|
|
39227
|
-
horizontalLines.push(itemMbr.top -
|
|
39226
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
39227
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
39228
39228
|
}
|
|
39229
39229
|
const tempStart = start;
|
|
39230
39230
|
const tempEnd = end;
|
package/dist/esm/browser.js
CHANGED
|
@@ -6909,7 +6909,8 @@ var conf = {
|
|
|
6909
6909
|
DECK_VERTICAL_OFFSET: 2,
|
|
6910
6910
|
CARD_DIMENSIONS: { width: 250, height: 400 },
|
|
6911
6911
|
DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 },
|
|
6912
|
-
MAX_CARD_SIZE: 500
|
|
6912
|
+
MAX_CARD_SIZE: 500,
|
|
6913
|
+
CONNECTOR_ITEM_OFFSET: 20
|
|
6913
6914
|
};
|
|
6914
6915
|
initDefaultI18N();
|
|
6915
6916
|
|
|
@@ -36514,7 +36515,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
36514
36515
|
}
|
|
36515
36516
|
|
|
36516
36517
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
36517
|
-
var ITEM_OFFSET = 1;
|
|
36518
36518
|
function getDirection(from, to) {
|
|
36519
36519
|
if (!to) {
|
|
36520
36520
|
return null;
|
|
@@ -36561,7 +36561,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
36561
36561
|
for (const pos of potentialNeighbors) {
|
|
36562
36562
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0 && grid[pos.x] && grid[pos.x][pos.y]) {
|
|
36563
36563
|
const newPoint = grid[pos.x][pos.y];
|
|
36564
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
36564
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
36565
36565
|
neighbors.push({
|
|
36566
36566
|
point: newPoint,
|
|
36567
36567
|
costSoFar: 0,
|
|
@@ -36581,22 +36581,22 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36581
36581
|
const endDir = getPointerDirection(end);
|
|
36582
36582
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36583
36583
|
const offsetMap = {
|
|
36584
|
-
top: { x: 0, y: -
|
|
36585
|
-
bottom: { x: 0, y:
|
|
36586
|
-
right: { x:
|
|
36587
|
-
left: { x: -
|
|
36584
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
36585
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
36586
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
36587
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
36588
36588
|
};
|
|
36589
36589
|
const horizontalLines = [];
|
|
36590
36590
|
const verticalLines = [];
|
|
36591
36591
|
if (start.pointType !== "Board") {
|
|
36592
36592
|
const itemMbr = start.item.getMbr();
|
|
36593
|
-
verticalLines.push(itemMbr.left -
|
|
36594
|
-
horizontalLines.push(itemMbr.top -
|
|
36593
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36594
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36595
36595
|
}
|
|
36596
36596
|
if (end.pointType !== "Board") {
|
|
36597
36597
|
const itemMbr = end.item.getMbr();
|
|
36598
|
-
verticalLines.push(itemMbr.left -
|
|
36599
|
-
horizontalLines.push(itemMbr.top -
|
|
36598
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36599
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36600
36600
|
}
|
|
36601
36601
|
const tempStart = start;
|
|
36602
36602
|
const tempEnd = end;
|
package/dist/esm/index.js
CHANGED
|
@@ -6902,7 +6902,8 @@ var conf = {
|
|
|
6902
6902
|
DECK_VERTICAL_OFFSET: 2,
|
|
6903
6903
|
CARD_DIMENSIONS: { width: 250, height: 400 },
|
|
6904
6904
|
DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 },
|
|
6905
|
-
MAX_CARD_SIZE: 500
|
|
6905
|
+
MAX_CARD_SIZE: 500,
|
|
6906
|
+
CONNECTOR_ITEM_OFFSET: 20
|
|
6906
6907
|
};
|
|
6907
6908
|
initDefaultI18N();
|
|
6908
6909
|
|
|
@@ -36507,7 +36508,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
36507
36508
|
}
|
|
36508
36509
|
|
|
36509
36510
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
36510
|
-
var ITEM_OFFSET = 1;
|
|
36511
36511
|
function getDirection(from, to) {
|
|
36512
36512
|
if (!to) {
|
|
36513
36513
|
return null;
|
|
@@ -36554,7 +36554,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
36554
36554
|
for (const pos of potentialNeighbors) {
|
|
36555
36555
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0 && grid[pos.x] && grid[pos.x][pos.y]) {
|
|
36556
36556
|
const newPoint = grid[pos.x][pos.y];
|
|
36557
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
36557
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
36558
36558
|
neighbors.push({
|
|
36559
36559
|
point: newPoint,
|
|
36560
36560
|
costSoFar: 0,
|
|
@@ -36574,22 +36574,22 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36574
36574
|
const endDir = getPointerDirection(end);
|
|
36575
36575
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36576
36576
|
const offsetMap = {
|
|
36577
|
-
top: { x: 0, y: -
|
|
36578
|
-
bottom: { x: 0, y:
|
|
36579
|
-
right: { x:
|
|
36580
|
-
left: { x: -
|
|
36577
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
36578
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
36579
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
36580
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
36581
36581
|
};
|
|
36582
36582
|
const horizontalLines = [];
|
|
36583
36583
|
const verticalLines = [];
|
|
36584
36584
|
if (start.pointType !== "Board") {
|
|
36585
36585
|
const itemMbr = start.item.getMbr();
|
|
36586
|
-
verticalLines.push(itemMbr.left -
|
|
36587
|
-
horizontalLines.push(itemMbr.top -
|
|
36586
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36587
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36588
36588
|
}
|
|
36589
36589
|
if (end.pointType !== "Board") {
|
|
36590
36590
|
const itemMbr = end.item.getMbr();
|
|
36591
|
-
verticalLines.push(itemMbr.left -
|
|
36592
|
-
horizontalLines.push(itemMbr.top -
|
|
36591
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36592
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36593
36593
|
}
|
|
36594
36594
|
const tempStart = start;
|
|
36595
36595
|
const tempEnd = end;
|
package/dist/esm/node.js
CHANGED
|
@@ -7686,7 +7686,8 @@ var conf = {
|
|
|
7686
7686
|
DECK_VERTICAL_OFFSET: 2,
|
|
7687
7687
|
CARD_DIMENSIONS: { width: 250, height: 400 },
|
|
7688
7688
|
DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 },
|
|
7689
|
-
MAX_CARD_SIZE: 500
|
|
7689
|
+
MAX_CARD_SIZE: 500,
|
|
7690
|
+
CONNECTOR_ITEM_OFFSET: 20
|
|
7690
7691
|
};
|
|
7691
7692
|
initDefaultI18N();
|
|
7692
7693
|
|
|
@@ -38975,7 +38976,6 @@ function radiansBetweenPoints(point1, point22) {
|
|
|
38975
38976
|
}
|
|
38976
38977
|
|
|
38977
38978
|
// src/Items/Connector/getLine/findOrthogonalPath.ts
|
|
38978
|
-
var ITEM_OFFSET = 1;
|
|
38979
38979
|
function getDirection(from, to) {
|
|
38980
38980
|
if (!to) {
|
|
38981
38981
|
return null;
|
|
@@ -39022,7 +39022,7 @@ function getNeighbors(node2, grid, obstacles) {
|
|
|
39022
39022
|
for (const pos of potentialNeighbors) {
|
|
39023
39023
|
if (pos.x >= 0 && pos.x < grid.length && pos.y >= 0 && grid[pos.x] && grid[pos.x][pos.y]) {
|
|
39024
39024
|
const newPoint = grid[pos.x][pos.y];
|
|
39025
|
-
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint,
|
|
39025
|
+
if (newPoint && !obstacles.some((obstacle) => obstacle.isAlmostInside(newPoint, conf.CONNECTOR_ITEM_OFFSET - 1))) {
|
|
39026
39026
|
neighbors.push({
|
|
39027
39027
|
point: newPoint,
|
|
39028
39028
|
costSoFar: 0,
|
|
@@ -39042,22 +39042,22 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
39042
39042
|
const endDir = getPointerDirection(end);
|
|
39043
39043
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
39044
39044
|
const offsetMap = {
|
|
39045
|
-
top: { x: 0, y: -
|
|
39046
|
-
bottom: { x: 0, y:
|
|
39047
|
-
right: { x:
|
|
39048
|
-
left: { x: -
|
|
39045
|
+
top: { x: 0, y: -conf.CONNECTOR_ITEM_OFFSET },
|
|
39046
|
+
bottom: { x: 0, y: conf.CONNECTOR_ITEM_OFFSET },
|
|
39047
|
+
right: { x: conf.CONNECTOR_ITEM_OFFSET, y: 0 },
|
|
39048
|
+
left: { x: -conf.CONNECTOR_ITEM_OFFSET, y: 0 }
|
|
39049
39049
|
};
|
|
39050
39050
|
const horizontalLines = [];
|
|
39051
39051
|
const verticalLines = [];
|
|
39052
39052
|
if (start.pointType !== "Board") {
|
|
39053
39053
|
const itemMbr = start.item.getMbr();
|
|
39054
|
-
verticalLines.push(itemMbr.left -
|
|
39055
|
-
horizontalLines.push(itemMbr.top -
|
|
39054
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
39055
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
39056
39056
|
}
|
|
39057
39057
|
if (end.pointType !== "Board") {
|
|
39058
39058
|
const itemMbr = end.item.getMbr();
|
|
39059
|
-
verticalLines.push(itemMbr.left -
|
|
39060
|
-
horizontalLines.push(itemMbr.top -
|
|
39059
|
+
verticalLines.push(itemMbr.left - conf.CONNECTOR_ITEM_OFFSET, itemMbr.left, itemMbr.right, itemMbr.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
39060
|
+
horizontalLines.push(itemMbr.top - conf.CONNECTOR_ITEM_OFFSET, itemMbr.top, itemMbr.bottom, itemMbr.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
39061
39061
|
}
|
|
39062
39062
|
const tempStart = start;
|
|
39063
39063
|
const tempEnd = end;
|
package/dist/types/Settings.d.ts
CHANGED