microboard-temp 0.13.88 → 0.13.90
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 +23 -7
- package/dist/cjs/index.js +23 -7
- package/dist/cjs/node.js +23 -7
- package/dist/esm/browser.js +23 -7
- package/dist/esm/index.js +23 -7
- package/dist/esm/node.js +23 -7
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -63897,7 +63897,21 @@ function createCanvasDrawer(board) {
|
|
|
63897
63897
|
}).filter((item) => !!item);
|
|
63898
63898
|
items.forEach((item) => {
|
|
63899
63899
|
if (item.itemType !== "Frame") {
|
|
63900
|
-
item
|
|
63900
|
+
const baseItem = item;
|
|
63901
|
+
const isNested = baseItem.parent && baseItem.parent !== "Board";
|
|
63902
|
+
if (isNested) {
|
|
63903
|
+
const container2 = board2.items.getById(baseItem.parent);
|
|
63904
|
+
if (container2) {
|
|
63905
|
+
context.ctx.save();
|
|
63906
|
+
container2.getNestingMatrix().applyToContext(context.ctx);
|
|
63907
|
+
item.render(context);
|
|
63908
|
+
context.ctx.restore();
|
|
63909
|
+
} else {
|
|
63910
|
+
item.render(context);
|
|
63911
|
+
}
|
|
63912
|
+
} else {
|
|
63913
|
+
item.render(context);
|
|
63914
|
+
}
|
|
63901
63915
|
board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
|
|
63902
63916
|
}
|
|
63903
63917
|
});
|
|
@@ -64008,10 +64022,12 @@ function createCanvasDrawer(board) {
|
|
|
64008
64022
|
return translation.map((i) => i.id).reduce((mbr, id) => {
|
|
64009
64023
|
const item = board.items.getById(id);
|
|
64010
64024
|
if (item) {
|
|
64025
|
+
const baseItem = item;
|
|
64026
|
+
const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
|
|
64011
64027
|
if (!mbr) {
|
|
64012
|
-
mbr =
|
|
64028
|
+
mbr = itemMbr;
|
|
64013
64029
|
} else {
|
|
64014
|
-
mbr.combine(
|
|
64030
|
+
mbr.combine(itemMbr);
|
|
64015
64031
|
if (item.itemType === "Frame") {
|
|
64016
64032
|
mbr.combine(item.getRichText().getMbr());
|
|
64017
64033
|
}
|
|
@@ -64665,7 +64681,7 @@ class AlignmentHelper {
|
|
|
64665
64681
|
if (!Array.isArray(movingItem) && movingItem.itemType === "Comment") {
|
|
64666
64682
|
return { verticalLines: [], horizontalLines: [] };
|
|
64667
64683
|
}
|
|
64668
|
-
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) :
|
|
64684
|
+
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) : movingItem.getWorldMbr();
|
|
64669
64685
|
const camera = this.board.camera.getMbr();
|
|
64670
64686
|
const cameraWidth = camera.getWidth();
|
|
64671
64687
|
const scale = this.board.camera.getScale();
|
|
@@ -64696,7 +64712,7 @@ class AlignmentHelper {
|
|
|
64696
64712
|
if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
|
|
64697
64713
|
return;
|
|
64698
64714
|
}
|
|
64699
|
-
const itemMbr = item.
|
|
64715
|
+
const itemMbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
64700
64716
|
const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
|
|
64701
64717
|
const centerXItem = (itemMbr.left + itemMbr.right) / 2;
|
|
64702
64718
|
const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
|
|
@@ -64779,7 +64795,7 @@ class AlignmentHelper {
|
|
|
64779
64795
|
return { lines };
|
|
64780
64796
|
}
|
|
64781
64797
|
snapToClosestLine(draggingItem, snapLines, beginTimeStamp, cursorPosition) {
|
|
64782
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
64798
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
64783
64799
|
const itemCenterX = (itemMbr.left + itemMbr.right) / 2;
|
|
64784
64800
|
const itemCenterY = (itemMbr.top + itemMbr.bottom) / 2;
|
|
64785
64801
|
const scale = this.board.camera.getScale();
|
|
@@ -64893,7 +64909,7 @@ class AlignmentHelper {
|
|
|
64893
64909
|
return snapToLine(snapLines.verticalLines, true) || snapToLine(snapLines.horizontalLines, false);
|
|
64894
64910
|
}
|
|
64895
64911
|
snapToSide(draggingItem, snapLines, beginTimeStamp, side) {
|
|
64896
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
64912
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
64897
64913
|
const getAlignmentInfo = (line, side2) => {
|
|
64898
64914
|
const alignments = {
|
|
64899
64915
|
left: {
|
package/dist/cjs/index.js
CHANGED
|
@@ -63897,7 +63897,21 @@ function createCanvasDrawer(board) {
|
|
|
63897
63897
|
}).filter((item) => !!item);
|
|
63898
63898
|
items.forEach((item) => {
|
|
63899
63899
|
if (item.itemType !== "Frame") {
|
|
63900
|
-
item
|
|
63900
|
+
const baseItem = item;
|
|
63901
|
+
const isNested = baseItem.parent && baseItem.parent !== "Board";
|
|
63902
|
+
if (isNested) {
|
|
63903
|
+
const container2 = board2.items.getById(baseItem.parent);
|
|
63904
|
+
if (container2) {
|
|
63905
|
+
context.ctx.save();
|
|
63906
|
+
container2.getNestingMatrix().applyToContext(context.ctx);
|
|
63907
|
+
item.render(context);
|
|
63908
|
+
context.ctx.restore();
|
|
63909
|
+
} else {
|
|
63910
|
+
item.render(context);
|
|
63911
|
+
}
|
|
63912
|
+
} else {
|
|
63913
|
+
item.render(context);
|
|
63914
|
+
}
|
|
63901
63915
|
board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
|
|
63902
63916
|
}
|
|
63903
63917
|
});
|
|
@@ -64008,10 +64022,12 @@ function createCanvasDrawer(board) {
|
|
|
64008
64022
|
return translation.map((i) => i.id).reduce((mbr, id) => {
|
|
64009
64023
|
const item = board.items.getById(id);
|
|
64010
64024
|
if (item) {
|
|
64025
|
+
const baseItem = item;
|
|
64026
|
+
const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
|
|
64011
64027
|
if (!mbr) {
|
|
64012
|
-
mbr =
|
|
64028
|
+
mbr = itemMbr;
|
|
64013
64029
|
} else {
|
|
64014
|
-
mbr.combine(
|
|
64030
|
+
mbr.combine(itemMbr);
|
|
64015
64031
|
if (item.itemType === "Frame") {
|
|
64016
64032
|
mbr.combine(item.getRichText().getMbr());
|
|
64017
64033
|
}
|
|
@@ -64665,7 +64681,7 @@ class AlignmentHelper {
|
|
|
64665
64681
|
if (!Array.isArray(movingItem) && movingItem.itemType === "Comment") {
|
|
64666
64682
|
return { verticalLines: [], horizontalLines: [] };
|
|
64667
64683
|
}
|
|
64668
|
-
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) :
|
|
64684
|
+
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) : movingItem.getWorldMbr();
|
|
64669
64685
|
const camera = this.board.camera.getMbr();
|
|
64670
64686
|
const cameraWidth = camera.getWidth();
|
|
64671
64687
|
const scale = this.board.camera.getScale();
|
|
@@ -64696,7 +64712,7 @@ class AlignmentHelper {
|
|
|
64696
64712
|
if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
|
|
64697
64713
|
return;
|
|
64698
64714
|
}
|
|
64699
|
-
const itemMbr = item.
|
|
64715
|
+
const itemMbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
64700
64716
|
const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
|
|
64701
64717
|
const centerXItem = (itemMbr.left + itemMbr.right) / 2;
|
|
64702
64718
|
const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
|
|
@@ -64779,7 +64795,7 @@ class AlignmentHelper {
|
|
|
64779
64795
|
return { lines };
|
|
64780
64796
|
}
|
|
64781
64797
|
snapToClosestLine(draggingItem, snapLines, beginTimeStamp, cursorPosition) {
|
|
64782
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
64798
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
64783
64799
|
const itemCenterX = (itemMbr.left + itemMbr.right) / 2;
|
|
64784
64800
|
const itemCenterY = (itemMbr.top + itemMbr.bottom) / 2;
|
|
64785
64801
|
const scale = this.board.camera.getScale();
|
|
@@ -64893,7 +64909,7 @@ class AlignmentHelper {
|
|
|
64893
64909
|
return snapToLine(snapLines.verticalLines, true) || snapToLine(snapLines.horizontalLines, false);
|
|
64894
64910
|
}
|
|
64895
64911
|
snapToSide(draggingItem, snapLines, beginTimeStamp, side) {
|
|
64896
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
64912
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
64897
64913
|
const getAlignmentInfo = (line, side2) => {
|
|
64898
64914
|
const alignments = {
|
|
64899
64915
|
left: {
|
package/dist/cjs/node.js
CHANGED
|
@@ -66317,7 +66317,21 @@ function createCanvasDrawer(board) {
|
|
|
66317
66317
|
}).filter((item) => !!item);
|
|
66318
66318
|
items.forEach((item) => {
|
|
66319
66319
|
if (item.itemType !== "Frame") {
|
|
66320
|
-
item
|
|
66320
|
+
const baseItem = item;
|
|
66321
|
+
const isNested = baseItem.parent && baseItem.parent !== "Board";
|
|
66322
|
+
if (isNested) {
|
|
66323
|
+
const container2 = board2.items.getById(baseItem.parent);
|
|
66324
|
+
if (container2) {
|
|
66325
|
+
context.ctx.save();
|
|
66326
|
+
container2.getNestingMatrix().applyToContext(context.ctx);
|
|
66327
|
+
item.render(context);
|
|
66328
|
+
context.ctx.restore();
|
|
66329
|
+
} else {
|
|
66330
|
+
item.render(context);
|
|
66331
|
+
}
|
|
66332
|
+
} else {
|
|
66333
|
+
item.render(context);
|
|
66334
|
+
}
|
|
66321
66335
|
board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
|
|
66322
66336
|
}
|
|
66323
66337
|
});
|
|
@@ -66428,10 +66442,12 @@ function createCanvasDrawer(board) {
|
|
|
66428
66442
|
return translation.map((i) => i.id).reduce((mbr, id) => {
|
|
66429
66443
|
const item = board.items.getById(id);
|
|
66430
66444
|
if (item) {
|
|
66445
|
+
const baseItem = item;
|
|
66446
|
+
const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
|
|
66431
66447
|
if (!mbr) {
|
|
66432
|
-
mbr =
|
|
66448
|
+
mbr = itemMbr;
|
|
66433
66449
|
} else {
|
|
66434
|
-
mbr.combine(
|
|
66450
|
+
mbr.combine(itemMbr);
|
|
66435
66451
|
if (item.itemType === "Frame") {
|
|
66436
66452
|
mbr.combine(item.getRichText().getMbr());
|
|
66437
66453
|
}
|
|
@@ -67085,7 +67101,7 @@ class AlignmentHelper {
|
|
|
67085
67101
|
if (!Array.isArray(movingItem) && movingItem.itemType === "Comment") {
|
|
67086
67102
|
return { verticalLines: [], horizontalLines: [] };
|
|
67087
67103
|
}
|
|
67088
|
-
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) :
|
|
67104
|
+
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) : movingItem.getWorldMbr();
|
|
67089
67105
|
const camera = this.board.camera.getMbr();
|
|
67090
67106
|
const cameraWidth = camera.getWidth();
|
|
67091
67107
|
const scale = this.board.camera.getScale();
|
|
@@ -67116,7 +67132,7 @@ class AlignmentHelper {
|
|
|
67116
67132
|
if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
|
|
67117
67133
|
return;
|
|
67118
67134
|
}
|
|
67119
|
-
const itemMbr = item.
|
|
67135
|
+
const itemMbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
67120
67136
|
const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
|
|
67121
67137
|
const centerXItem = (itemMbr.left + itemMbr.right) / 2;
|
|
67122
67138
|
const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
|
|
@@ -67199,7 +67215,7 @@ class AlignmentHelper {
|
|
|
67199
67215
|
return { lines };
|
|
67200
67216
|
}
|
|
67201
67217
|
snapToClosestLine(draggingItem, snapLines, beginTimeStamp, cursorPosition) {
|
|
67202
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
67218
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
67203
67219
|
const itemCenterX = (itemMbr.left + itemMbr.right) / 2;
|
|
67204
67220
|
const itemCenterY = (itemMbr.top + itemMbr.bottom) / 2;
|
|
67205
67221
|
const scale = this.board.camera.getScale();
|
|
@@ -67313,7 +67329,7 @@ class AlignmentHelper {
|
|
|
67313
67329
|
return snapToLine(snapLines.verticalLines, true) || snapToLine(snapLines.horizontalLines, false);
|
|
67314
67330
|
}
|
|
67315
67331
|
snapToSide(draggingItem, snapLines, beginTimeStamp, side) {
|
|
67316
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
67332
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
67317
67333
|
const getAlignmentInfo = (line, side2) => {
|
|
67318
67334
|
const alignments = {
|
|
67319
67335
|
left: {
|
package/dist/esm/browser.js
CHANGED
|
@@ -63835,7 +63835,21 @@ function createCanvasDrawer(board) {
|
|
|
63835
63835
|
}).filter((item) => !!item);
|
|
63836
63836
|
items.forEach((item) => {
|
|
63837
63837
|
if (item.itemType !== "Frame") {
|
|
63838
|
-
item
|
|
63838
|
+
const baseItem = item;
|
|
63839
|
+
const isNested = baseItem.parent && baseItem.parent !== "Board";
|
|
63840
|
+
if (isNested) {
|
|
63841
|
+
const container2 = board2.items.getById(baseItem.parent);
|
|
63842
|
+
if (container2) {
|
|
63843
|
+
context.ctx.save();
|
|
63844
|
+
container2.getNestingMatrix().applyToContext(context.ctx);
|
|
63845
|
+
item.render(context);
|
|
63846
|
+
context.ctx.restore();
|
|
63847
|
+
} else {
|
|
63848
|
+
item.render(context);
|
|
63849
|
+
}
|
|
63850
|
+
} else {
|
|
63851
|
+
item.render(context);
|
|
63852
|
+
}
|
|
63839
63853
|
board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
|
|
63840
63854
|
}
|
|
63841
63855
|
});
|
|
@@ -63946,10 +63960,12 @@ function createCanvasDrawer(board) {
|
|
|
63946
63960
|
return translation.map((i) => i.id).reduce((mbr, id) => {
|
|
63947
63961
|
const item = board.items.getById(id);
|
|
63948
63962
|
if (item) {
|
|
63963
|
+
const baseItem = item;
|
|
63964
|
+
const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
|
|
63949
63965
|
if (!mbr) {
|
|
63950
|
-
mbr =
|
|
63966
|
+
mbr = itemMbr;
|
|
63951
63967
|
} else {
|
|
63952
|
-
mbr.combine(
|
|
63968
|
+
mbr.combine(itemMbr);
|
|
63953
63969
|
if (item.itemType === "Frame") {
|
|
63954
63970
|
mbr.combine(item.getRichText().getMbr());
|
|
63955
63971
|
}
|
|
@@ -64603,7 +64619,7 @@ class AlignmentHelper {
|
|
|
64603
64619
|
if (!Array.isArray(movingItem) && movingItem.itemType === "Comment") {
|
|
64604
64620
|
return { verticalLines: [], horizontalLines: [] };
|
|
64605
64621
|
}
|
|
64606
|
-
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) :
|
|
64622
|
+
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) : movingItem.getWorldMbr();
|
|
64607
64623
|
const camera = this.board.camera.getMbr();
|
|
64608
64624
|
const cameraWidth = camera.getWidth();
|
|
64609
64625
|
const scale = this.board.camera.getScale();
|
|
@@ -64634,7 +64650,7 @@ class AlignmentHelper {
|
|
|
64634
64650
|
if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
|
|
64635
64651
|
return;
|
|
64636
64652
|
}
|
|
64637
|
-
const itemMbr = item.
|
|
64653
|
+
const itemMbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
64638
64654
|
const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
|
|
64639
64655
|
const centerXItem = (itemMbr.left + itemMbr.right) / 2;
|
|
64640
64656
|
const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
|
|
@@ -64717,7 +64733,7 @@ class AlignmentHelper {
|
|
|
64717
64733
|
return { lines };
|
|
64718
64734
|
}
|
|
64719
64735
|
snapToClosestLine(draggingItem, snapLines, beginTimeStamp, cursorPosition) {
|
|
64720
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
64736
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
64721
64737
|
const itemCenterX = (itemMbr.left + itemMbr.right) / 2;
|
|
64722
64738
|
const itemCenterY = (itemMbr.top + itemMbr.bottom) / 2;
|
|
64723
64739
|
const scale = this.board.camera.getScale();
|
|
@@ -64831,7 +64847,7 @@ class AlignmentHelper {
|
|
|
64831
64847
|
return snapToLine(snapLines.verticalLines, true) || snapToLine(snapLines.horizontalLines, false);
|
|
64832
64848
|
}
|
|
64833
64849
|
snapToSide(draggingItem, snapLines, beginTimeStamp, side) {
|
|
64834
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
64850
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
64835
64851
|
const getAlignmentInfo = (line, side2) => {
|
|
64836
64852
|
const alignments = {
|
|
64837
64853
|
left: {
|
package/dist/esm/index.js
CHANGED
|
@@ -63828,7 +63828,21 @@ function createCanvasDrawer(board) {
|
|
|
63828
63828
|
}).filter((item) => !!item);
|
|
63829
63829
|
items.forEach((item) => {
|
|
63830
63830
|
if (item.itemType !== "Frame") {
|
|
63831
|
-
item
|
|
63831
|
+
const baseItem = item;
|
|
63832
|
+
const isNested = baseItem.parent && baseItem.parent !== "Board";
|
|
63833
|
+
if (isNested) {
|
|
63834
|
+
const container2 = board2.items.getById(baseItem.parent);
|
|
63835
|
+
if (container2) {
|
|
63836
|
+
context.ctx.save();
|
|
63837
|
+
container2.getNestingMatrix().applyToContext(context.ctx);
|
|
63838
|
+
item.render(context);
|
|
63839
|
+
context.ctx.restore();
|
|
63840
|
+
} else {
|
|
63841
|
+
item.render(context);
|
|
63842
|
+
}
|
|
63843
|
+
} else {
|
|
63844
|
+
item.render(context);
|
|
63845
|
+
}
|
|
63832
63846
|
board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
|
|
63833
63847
|
}
|
|
63834
63848
|
});
|
|
@@ -63939,10 +63953,12 @@ function createCanvasDrawer(board) {
|
|
|
63939
63953
|
return translation.map((i) => i.id).reduce((mbr, id) => {
|
|
63940
63954
|
const item = board.items.getById(id);
|
|
63941
63955
|
if (item) {
|
|
63956
|
+
const baseItem = item;
|
|
63957
|
+
const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
|
|
63942
63958
|
if (!mbr) {
|
|
63943
|
-
mbr =
|
|
63959
|
+
mbr = itemMbr;
|
|
63944
63960
|
} else {
|
|
63945
|
-
mbr.combine(
|
|
63961
|
+
mbr.combine(itemMbr);
|
|
63946
63962
|
if (item.itemType === "Frame") {
|
|
63947
63963
|
mbr.combine(item.getRichText().getMbr());
|
|
63948
63964
|
}
|
|
@@ -64596,7 +64612,7 @@ class AlignmentHelper {
|
|
|
64596
64612
|
if (!Array.isArray(movingItem) && movingItem.itemType === "Comment") {
|
|
64597
64613
|
return { verticalLines: [], horizontalLines: [] };
|
|
64598
64614
|
}
|
|
64599
|
-
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) :
|
|
64615
|
+
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) : movingItem.getWorldMbr();
|
|
64600
64616
|
const camera = this.board.camera.getMbr();
|
|
64601
64617
|
const cameraWidth = camera.getWidth();
|
|
64602
64618
|
const scale = this.board.camera.getScale();
|
|
@@ -64627,7 +64643,7 @@ class AlignmentHelper {
|
|
|
64627
64643
|
if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
|
|
64628
64644
|
return;
|
|
64629
64645
|
}
|
|
64630
|
-
const itemMbr = item.
|
|
64646
|
+
const itemMbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
64631
64647
|
const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
|
|
64632
64648
|
const centerXItem = (itemMbr.left + itemMbr.right) / 2;
|
|
64633
64649
|
const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
|
|
@@ -64710,7 +64726,7 @@ class AlignmentHelper {
|
|
|
64710
64726
|
return { lines };
|
|
64711
64727
|
}
|
|
64712
64728
|
snapToClosestLine(draggingItem, snapLines, beginTimeStamp, cursorPosition) {
|
|
64713
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
64729
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
64714
64730
|
const itemCenterX = (itemMbr.left + itemMbr.right) / 2;
|
|
64715
64731
|
const itemCenterY = (itemMbr.top + itemMbr.bottom) / 2;
|
|
64716
64732
|
const scale = this.board.camera.getScale();
|
|
@@ -64824,7 +64840,7 @@ class AlignmentHelper {
|
|
|
64824
64840
|
return snapToLine(snapLines.verticalLines, true) || snapToLine(snapLines.horizontalLines, false);
|
|
64825
64841
|
}
|
|
64826
64842
|
snapToSide(draggingItem, snapLines, beginTimeStamp, side) {
|
|
64827
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
64843
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
64828
64844
|
const getAlignmentInfo = (line, side2) => {
|
|
64829
64845
|
const alignments = {
|
|
64830
64846
|
left: {
|
package/dist/esm/node.js
CHANGED
|
@@ -66237,7 +66237,21 @@ function createCanvasDrawer(board) {
|
|
|
66237
66237
|
}).filter((item) => !!item);
|
|
66238
66238
|
items.forEach((item) => {
|
|
66239
66239
|
if (item.itemType !== "Frame") {
|
|
66240
|
-
item
|
|
66240
|
+
const baseItem = item;
|
|
66241
|
+
const isNested = baseItem.parent && baseItem.parent !== "Board";
|
|
66242
|
+
if (isNested) {
|
|
66243
|
+
const container2 = board2.items.getById(baseItem.parent);
|
|
66244
|
+
if (container2) {
|
|
66245
|
+
context.ctx.save();
|
|
66246
|
+
container2.getNestingMatrix().applyToContext(context.ctx);
|
|
66247
|
+
item.render(context);
|
|
66248
|
+
context.ctx.restore();
|
|
66249
|
+
} else {
|
|
66250
|
+
item.render(context);
|
|
66251
|
+
}
|
|
66252
|
+
} else {
|
|
66253
|
+
item.render(context);
|
|
66254
|
+
}
|
|
66241
66255
|
board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
|
|
66242
66256
|
}
|
|
66243
66257
|
});
|
|
@@ -66348,10 +66362,12 @@ function createCanvasDrawer(board) {
|
|
|
66348
66362
|
return translation.map((i) => i.id).reduce((mbr, id) => {
|
|
66349
66363
|
const item = board.items.getById(id);
|
|
66350
66364
|
if (item) {
|
|
66365
|
+
const baseItem = item;
|
|
66366
|
+
const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
|
|
66351
66367
|
if (!mbr) {
|
|
66352
|
-
mbr =
|
|
66368
|
+
mbr = itemMbr;
|
|
66353
66369
|
} else {
|
|
66354
|
-
mbr.combine(
|
|
66370
|
+
mbr.combine(itemMbr);
|
|
66355
66371
|
if (item.itemType === "Frame") {
|
|
66356
66372
|
mbr.combine(item.getRichText().getMbr());
|
|
66357
66373
|
}
|
|
@@ -67005,7 +67021,7 @@ class AlignmentHelper {
|
|
|
67005
67021
|
if (!Array.isArray(movingItem) && movingItem.itemType === "Comment") {
|
|
67006
67022
|
return { verticalLines: [], horizontalLines: [] };
|
|
67007
67023
|
}
|
|
67008
|
-
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) :
|
|
67024
|
+
const movingMBR = this.canvasDrawer.getLastCreatedCanvas() ? this.canvasDrawer.getMbr() : Array.isArray(movingItem) ? this.combineMBRs(movingItem) : movingItem.getWorldMbr();
|
|
67009
67025
|
const camera = this.board.camera.getMbr();
|
|
67010
67026
|
const cameraWidth = camera.getWidth();
|
|
67011
67027
|
const scale = this.board.camera.getScale();
|
|
@@ -67036,7 +67052,7 @@ class AlignmentHelper {
|
|
|
67036
67052
|
if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
|
|
67037
67053
|
return;
|
|
67038
67054
|
}
|
|
67039
|
-
const itemMbr = item.
|
|
67055
|
+
const itemMbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
67040
67056
|
const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
|
|
67041
67057
|
const centerXItem = (itemMbr.left + itemMbr.right) / 2;
|
|
67042
67058
|
const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
|
|
@@ -67119,7 +67135,7 @@ class AlignmentHelper {
|
|
|
67119
67135
|
return { lines };
|
|
67120
67136
|
}
|
|
67121
67137
|
snapToClosestLine(draggingItem, snapLines, beginTimeStamp, cursorPosition) {
|
|
67122
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
67138
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
67123
67139
|
const itemCenterX = (itemMbr.left + itemMbr.right) / 2;
|
|
67124
67140
|
const itemCenterY = (itemMbr.top + itemMbr.bottom) / 2;
|
|
67125
67141
|
const scale = this.board.camera.getScale();
|
|
@@ -67233,7 +67249,7 @@ class AlignmentHelper {
|
|
|
67233
67249
|
return snapToLine(snapLines.verticalLines, true) || snapToLine(snapLines.horizontalLines, false);
|
|
67234
67250
|
}
|
|
67235
67251
|
snapToSide(draggingItem, snapLines, beginTimeStamp, side) {
|
|
67236
|
-
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem.getMbr();
|
|
67252
|
+
const itemMbr = Array.isArray(draggingItem) ? this.combineMBRs(draggingItem) : draggingItem instanceof BaseItem ? draggingItem.getWorldMbr() : draggingItem.getMbr();
|
|
67237
67253
|
const getAlignmentInfo = (line, side2) => {
|
|
67238
67254
|
const alignments = {
|
|
67239
67255
|
left: {
|