microboard-temp 0.5.139 → 0.5.141
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 +68 -52
- package/dist/cjs/index.js +68 -52
- package/dist/cjs/node.js +68 -52
- package/dist/esm/browser.js +68 -52
- package/dist/esm/index.js +68 -52
- package/dist/esm/node.js +68 -52
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -21946,15 +21946,19 @@ class RichText extends BaseItem {
|
|
|
21946
21946
|
});
|
|
21947
21947
|
this.transformation.subject.subscribe((tr, op) => {
|
|
21948
21948
|
this.prevMbr = this.getMbr();
|
|
21949
|
-
if (op.method === "
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
21954
|
-
|
|
21949
|
+
if (op.method === "applyMatrix") {
|
|
21950
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
21951
|
+
this.setAINodeShirkWidth();
|
|
21952
|
+
if (!this.isInShape) {
|
|
21953
|
+
this.transformCanvas();
|
|
21954
|
+
} else {
|
|
21955
|
+
this.updateElement();
|
|
21956
|
+
}
|
|
21955
21957
|
} else {
|
|
21956
|
-
this.
|
|
21958
|
+
this.transformCanvas();
|
|
21957
21959
|
}
|
|
21960
|
+
} else if (op.method === "transformMany") {
|
|
21961
|
+
this.transformCanvas();
|
|
21958
21962
|
} else if (op.method === "deserialize") {
|
|
21959
21963
|
this.setAINodeShirkWidth();
|
|
21960
21964
|
this.updateElement();
|
|
@@ -35896,23 +35900,24 @@ class AINode extends BaseItem {
|
|
|
35896
35900
|
this.linkTo = new LinkTo(this.id, this.board.events);
|
|
35897
35901
|
this.text = new RichText(this.board, new Mbr, this.id, this.transformation, this.linkTo, " ", false, false, "AINode");
|
|
35898
35902
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
35899
|
-
if (op.method === "
|
|
35900
|
-
|
|
35903
|
+
if (op.method === "applyMatrix") {
|
|
35904
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
35905
|
+
this.prevMbr = this.path?.getMbr();
|
|
35906
|
+
this.text.handleInshapeScale();
|
|
35907
|
+
} else {
|
|
35908
|
+
this.text.transformCanvas();
|
|
35909
|
+
}
|
|
35901
35910
|
} else if (op.method === "transformMany") {
|
|
35902
35911
|
const currItemOp = op.items[this.getId()];
|
|
35903
35912
|
this.prevMbr = this.path?.getMbr();
|
|
35904
|
-
if (currItemOp.method === "
|
|
35913
|
+
if (currItemOp.method === "applyMatrix" && currItemOp.matrix.scaleX === 1 && currItemOp.matrix.scaleY === 1) {
|
|
35905
35914
|
this.text.transformCanvas();
|
|
35906
35915
|
} else {
|
|
35907
35916
|
this.text.handleInshapeScale();
|
|
35908
35917
|
}
|
|
35909
35918
|
} else {
|
|
35910
35919
|
this.prevMbr = this.path?.getMbr();
|
|
35911
|
-
|
|
35912
|
-
this.text.handleInshapeScale();
|
|
35913
|
-
} else {
|
|
35914
|
-
this.text.updateElement();
|
|
35915
|
-
}
|
|
35920
|
+
this.text.updateElement();
|
|
35916
35921
|
}
|
|
35917
35922
|
this.transformPath();
|
|
35918
35923
|
this.subject.publish(this);
|
|
@@ -39417,7 +39422,7 @@ class Shape extends BaseItem {
|
|
|
39417
39422
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
39418
39423
|
this.transformPath();
|
|
39419
39424
|
this.updateMbr();
|
|
39420
|
-
if (op.method === "
|
|
39425
|
+
if (op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
39421
39426
|
this.text.transformCanvas();
|
|
39422
39427
|
} else {
|
|
39423
39428
|
this.text.updateElement();
|
|
@@ -39944,21 +39949,21 @@ class Sticker extends BaseItem {
|
|
|
39944
39949
|
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
|
|
39945
39950
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
39946
39951
|
this.transformPath();
|
|
39947
|
-
if (op.method === "
|
|
39948
|
-
|
|
39949
|
-
|
|
39950
|
-
|
|
39951
|
-
|
|
39952
|
-
|
|
39953
|
-
|
|
39954
|
-
|
|
39955
|
-
|
|
39952
|
+
if (op.method === "applyMatrix") {
|
|
39953
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
39954
|
+
if (this.text.isAutosize()) {
|
|
39955
|
+
this.text.scaleAutoSizeScale(Math.min(op.matrix.scaleX, op.matrix.scaleY));
|
|
39956
|
+
this.text.recoordinate();
|
|
39957
|
+
this.text.transformCanvas();
|
|
39958
|
+
} else {
|
|
39959
|
+
this.text.handleInshapeScale();
|
|
39960
|
+
}
|
|
39956
39961
|
}
|
|
39957
39962
|
} else if (op.method === "transformMany") {
|
|
39958
39963
|
const transformOp = op.items[this.id];
|
|
39959
|
-
if (transformOp.method === "
|
|
39964
|
+
if (transformOp.method === "applyMatrix" && (transformOp.matrix.scaleX !== 1 || transformOp.matrix.scaleY !== 1)) {
|
|
39960
39965
|
if (this.text.isAutosize()) {
|
|
39961
|
-
this.text.scaleAutoSizeScale(Math.min(transformOp.
|
|
39966
|
+
this.text.scaleAutoSizeScale(Math.min(transformOp.matrix.scaleX, transformOp.matrix.scaleY));
|
|
39962
39967
|
this.text.recoordinate();
|
|
39963
39968
|
this.text.transformCanvas();
|
|
39964
39969
|
} else {
|
|
@@ -48053,7 +48058,7 @@ class Card extends BaseItem {
|
|
|
48053
48058
|
this.board.bringToFront(this);
|
|
48054
48059
|
}, 1000);
|
|
48055
48060
|
this.transformation.subject.subscribe((_, op) => {
|
|
48056
|
-
if (this.parent === "Board" && op.method === "
|
|
48061
|
+
if (this.parent === "Board" && op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
48057
48062
|
this.throttledBringToFront();
|
|
48058
48063
|
}
|
|
48059
48064
|
this.updateMbr();
|
|
@@ -55056,34 +55061,45 @@ function mergeItems(opA, opB) {
|
|
|
55056
55061
|
};
|
|
55057
55062
|
} else if (opA.items[itemId].method === "scaleByTranslateBy") {
|
|
55058
55063
|
const newTransformation = resolve2(opA.items[itemId].scale, opA.items[itemId].translate, opB.items[itemId]);
|
|
55059
|
-
|
|
55060
|
-
|
|
55061
|
-
|
|
55062
|
-
|
|
55063
|
-
|
|
55064
|
-
|
|
55065
|
-
|
|
55066
|
-
|
|
55067
|
-
|
|
55068
|
-
|
|
55064
|
+
if (!newTransformation) {
|
|
55065
|
+
items[itemId] = opB.items[itemId];
|
|
55066
|
+
} else {
|
|
55067
|
+
items[itemId] = {
|
|
55068
|
+
class: "Transformation",
|
|
55069
|
+
method: "scaleByTranslateBy",
|
|
55070
|
+
item: [itemId],
|
|
55071
|
+
scale: newTransformation.scale,
|
|
55072
|
+
translate: newTransformation.translate
|
|
55073
|
+
};
|
|
55074
|
+
}
|
|
55069
55075
|
} else if (opA.items[itemId].method === "scaleBy") {
|
|
55070
55076
|
const newTransformation = resolve2({ x: opA.items[itemId].x, y: opA.items[itemId].y }, undefined, opB.items[itemId]);
|
|
55071
|
-
|
|
55072
|
-
|
|
55073
|
-
|
|
55074
|
-
|
|
55075
|
-
|
|
55076
|
-
|
|
55077
|
-
|
|
55077
|
+
if (!newTransformation) {
|
|
55078
|
+
items[itemId] = opB.items[itemId];
|
|
55079
|
+
} else {
|
|
55080
|
+
items[itemId] = {
|
|
55081
|
+
class: "Transformation",
|
|
55082
|
+
method: "scaleByTranslateBy",
|
|
55083
|
+
item: [itemId],
|
|
55084
|
+
scale: newTransformation.scale,
|
|
55085
|
+
translate: newTransformation.translate
|
|
55086
|
+
};
|
|
55087
|
+
}
|
|
55078
55088
|
} else if (opA.items[itemId].method === "translateBy") {
|
|
55079
55089
|
const newTransformation = resolve2(undefined, { x: opA.items[itemId].x, y: opA.items[itemId].y }, opB.items[itemId]);
|
|
55080
|
-
|
|
55081
|
-
|
|
55082
|
-
|
|
55083
|
-
|
|
55084
|
-
|
|
55085
|
-
|
|
55086
|
-
|
|
55090
|
+
if (!newTransformation) {
|
|
55091
|
+
items[itemId] = opB.items[itemId];
|
|
55092
|
+
} else {
|
|
55093
|
+
items[itemId] = {
|
|
55094
|
+
class: "Transformation",
|
|
55095
|
+
method: "scaleByTranslateBy",
|
|
55096
|
+
item: [itemId],
|
|
55097
|
+
scale: newTransformation.scale,
|
|
55098
|
+
translate: newTransformation.translate
|
|
55099
|
+
};
|
|
55100
|
+
}
|
|
55101
|
+
} else {
|
|
55102
|
+
items[itemId] = opB.items[itemId];
|
|
55087
55103
|
}
|
|
55088
55104
|
} else {
|
|
55089
55105
|
items[itemId] = opB.items[itemId];
|
package/dist/cjs/index.js
CHANGED
|
@@ -21946,15 +21946,19 @@ class RichText extends BaseItem {
|
|
|
21946
21946
|
});
|
|
21947
21947
|
this.transformation.subject.subscribe((tr, op) => {
|
|
21948
21948
|
this.prevMbr = this.getMbr();
|
|
21949
|
-
if (op.method === "
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
21954
|
-
|
|
21949
|
+
if (op.method === "applyMatrix") {
|
|
21950
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
21951
|
+
this.setAINodeShirkWidth();
|
|
21952
|
+
if (!this.isInShape) {
|
|
21953
|
+
this.transformCanvas();
|
|
21954
|
+
} else {
|
|
21955
|
+
this.updateElement();
|
|
21956
|
+
}
|
|
21955
21957
|
} else {
|
|
21956
|
-
this.
|
|
21958
|
+
this.transformCanvas();
|
|
21957
21959
|
}
|
|
21960
|
+
} else if (op.method === "transformMany") {
|
|
21961
|
+
this.transformCanvas();
|
|
21958
21962
|
} else if (op.method === "deserialize") {
|
|
21959
21963
|
this.setAINodeShirkWidth();
|
|
21960
21964
|
this.updateElement();
|
|
@@ -35896,23 +35900,24 @@ class AINode extends BaseItem {
|
|
|
35896
35900
|
this.linkTo = new LinkTo(this.id, this.board.events);
|
|
35897
35901
|
this.text = new RichText(this.board, new Mbr, this.id, this.transformation, this.linkTo, " ", false, false, "AINode");
|
|
35898
35902
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
35899
|
-
if (op.method === "
|
|
35900
|
-
|
|
35903
|
+
if (op.method === "applyMatrix") {
|
|
35904
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
35905
|
+
this.prevMbr = this.path?.getMbr();
|
|
35906
|
+
this.text.handleInshapeScale();
|
|
35907
|
+
} else {
|
|
35908
|
+
this.text.transformCanvas();
|
|
35909
|
+
}
|
|
35901
35910
|
} else if (op.method === "transformMany") {
|
|
35902
35911
|
const currItemOp = op.items[this.getId()];
|
|
35903
35912
|
this.prevMbr = this.path?.getMbr();
|
|
35904
|
-
if (currItemOp.method === "
|
|
35913
|
+
if (currItemOp.method === "applyMatrix" && currItemOp.matrix.scaleX === 1 && currItemOp.matrix.scaleY === 1) {
|
|
35905
35914
|
this.text.transformCanvas();
|
|
35906
35915
|
} else {
|
|
35907
35916
|
this.text.handleInshapeScale();
|
|
35908
35917
|
}
|
|
35909
35918
|
} else {
|
|
35910
35919
|
this.prevMbr = this.path?.getMbr();
|
|
35911
|
-
|
|
35912
|
-
this.text.handleInshapeScale();
|
|
35913
|
-
} else {
|
|
35914
|
-
this.text.updateElement();
|
|
35915
|
-
}
|
|
35920
|
+
this.text.updateElement();
|
|
35916
35921
|
}
|
|
35917
35922
|
this.transformPath();
|
|
35918
35923
|
this.subject.publish(this);
|
|
@@ -39417,7 +39422,7 @@ class Shape extends BaseItem {
|
|
|
39417
39422
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
39418
39423
|
this.transformPath();
|
|
39419
39424
|
this.updateMbr();
|
|
39420
|
-
if (op.method === "
|
|
39425
|
+
if (op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
39421
39426
|
this.text.transformCanvas();
|
|
39422
39427
|
} else {
|
|
39423
39428
|
this.text.updateElement();
|
|
@@ -39944,21 +39949,21 @@ class Sticker extends BaseItem {
|
|
|
39944
39949
|
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
|
|
39945
39950
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
39946
39951
|
this.transformPath();
|
|
39947
|
-
if (op.method === "
|
|
39948
|
-
|
|
39949
|
-
|
|
39950
|
-
|
|
39951
|
-
|
|
39952
|
-
|
|
39953
|
-
|
|
39954
|
-
|
|
39955
|
-
|
|
39952
|
+
if (op.method === "applyMatrix") {
|
|
39953
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
39954
|
+
if (this.text.isAutosize()) {
|
|
39955
|
+
this.text.scaleAutoSizeScale(Math.min(op.matrix.scaleX, op.matrix.scaleY));
|
|
39956
|
+
this.text.recoordinate();
|
|
39957
|
+
this.text.transformCanvas();
|
|
39958
|
+
} else {
|
|
39959
|
+
this.text.handleInshapeScale();
|
|
39960
|
+
}
|
|
39956
39961
|
}
|
|
39957
39962
|
} else if (op.method === "transformMany") {
|
|
39958
39963
|
const transformOp = op.items[this.id];
|
|
39959
|
-
if (transformOp.method === "
|
|
39964
|
+
if (transformOp.method === "applyMatrix" && (transformOp.matrix.scaleX !== 1 || transformOp.matrix.scaleY !== 1)) {
|
|
39960
39965
|
if (this.text.isAutosize()) {
|
|
39961
|
-
this.text.scaleAutoSizeScale(Math.min(transformOp.
|
|
39966
|
+
this.text.scaleAutoSizeScale(Math.min(transformOp.matrix.scaleX, transformOp.matrix.scaleY));
|
|
39962
39967
|
this.text.recoordinate();
|
|
39963
39968
|
this.text.transformCanvas();
|
|
39964
39969
|
} else {
|
|
@@ -48053,7 +48058,7 @@ class Card extends BaseItem {
|
|
|
48053
48058
|
this.board.bringToFront(this);
|
|
48054
48059
|
}, 1000);
|
|
48055
48060
|
this.transformation.subject.subscribe((_, op) => {
|
|
48056
|
-
if (this.parent === "Board" && op.method === "
|
|
48061
|
+
if (this.parent === "Board" && op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
48057
48062
|
this.throttledBringToFront();
|
|
48058
48063
|
}
|
|
48059
48064
|
this.updateMbr();
|
|
@@ -55056,34 +55061,45 @@ function mergeItems(opA, opB) {
|
|
|
55056
55061
|
};
|
|
55057
55062
|
} else if (opA.items[itemId].method === "scaleByTranslateBy") {
|
|
55058
55063
|
const newTransformation = resolve2(opA.items[itemId].scale, opA.items[itemId].translate, opB.items[itemId]);
|
|
55059
|
-
|
|
55060
|
-
|
|
55061
|
-
|
|
55062
|
-
|
|
55063
|
-
|
|
55064
|
-
|
|
55065
|
-
|
|
55066
|
-
|
|
55067
|
-
|
|
55068
|
-
|
|
55064
|
+
if (!newTransformation) {
|
|
55065
|
+
items[itemId] = opB.items[itemId];
|
|
55066
|
+
} else {
|
|
55067
|
+
items[itemId] = {
|
|
55068
|
+
class: "Transformation",
|
|
55069
|
+
method: "scaleByTranslateBy",
|
|
55070
|
+
item: [itemId],
|
|
55071
|
+
scale: newTransformation.scale,
|
|
55072
|
+
translate: newTransformation.translate
|
|
55073
|
+
};
|
|
55074
|
+
}
|
|
55069
55075
|
} else if (opA.items[itemId].method === "scaleBy") {
|
|
55070
55076
|
const newTransformation = resolve2({ x: opA.items[itemId].x, y: opA.items[itemId].y }, undefined, opB.items[itemId]);
|
|
55071
|
-
|
|
55072
|
-
|
|
55073
|
-
|
|
55074
|
-
|
|
55075
|
-
|
|
55076
|
-
|
|
55077
|
-
|
|
55077
|
+
if (!newTransformation) {
|
|
55078
|
+
items[itemId] = opB.items[itemId];
|
|
55079
|
+
} else {
|
|
55080
|
+
items[itemId] = {
|
|
55081
|
+
class: "Transformation",
|
|
55082
|
+
method: "scaleByTranslateBy",
|
|
55083
|
+
item: [itemId],
|
|
55084
|
+
scale: newTransformation.scale,
|
|
55085
|
+
translate: newTransformation.translate
|
|
55086
|
+
};
|
|
55087
|
+
}
|
|
55078
55088
|
} else if (opA.items[itemId].method === "translateBy") {
|
|
55079
55089
|
const newTransformation = resolve2(undefined, { x: opA.items[itemId].x, y: opA.items[itemId].y }, opB.items[itemId]);
|
|
55080
|
-
|
|
55081
|
-
|
|
55082
|
-
|
|
55083
|
-
|
|
55084
|
-
|
|
55085
|
-
|
|
55086
|
-
|
|
55090
|
+
if (!newTransformation) {
|
|
55091
|
+
items[itemId] = opB.items[itemId];
|
|
55092
|
+
} else {
|
|
55093
|
+
items[itemId] = {
|
|
55094
|
+
class: "Transformation",
|
|
55095
|
+
method: "scaleByTranslateBy",
|
|
55096
|
+
item: [itemId],
|
|
55097
|
+
scale: newTransformation.scale,
|
|
55098
|
+
translate: newTransformation.translate
|
|
55099
|
+
};
|
|
55100
|
+
}
|
|
55101
|
+
} else {
|
|
55102
|
+
items[itemId] = opB.items[itemId];
|
|
55087
55103
|
}
|
|
55088
55104
|
} else {
|
|
55089
55105
|
items[itemId] = opB.items[itemId];
|
package/dist/cjs/node.js
CHANGED
|
@@ -24418,15 +24418,19 @@ class RichText extends BaseItem {
|
|
|
24418
24418
|
});
|
|
24419
24419
|
this.transformation.subject.subscribe((tr, op) => {
|
|
24420
24420
|
this.prevMbr = this.getMbr();
|
|
24421
|
-
if (op.method === "
|
|
24422
|
-
|
|
24423
|
-
|
|
24424
|
-
|
|
24425
|
-
|
|
24426
|
-
|
|
24421
|
+
if (op.method === "applyMatrix") {
|
|
24422
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
24423
|
+
this.setAINodeShirkWidth();
|
|
24424
|
+
if (!this.isInShape) {
|
|
24425
|
+
this.transformCanvas();
|
|
24426
|
+
} else {
|
|
24427
|
+
this.updateElement();
|
|
24428
|
+
}
|
|
24427
24429
|
} else {
|
|
24428
|
-
this.
|
|
24430
|
+
this.transformCanvas();
|
|
24429
24431
|
}
|
|
24432
|
+
} else if (op.method === "transformMany") {
|
|
24433
|
+
this.transformCanvas();
|
|
24430
24434
|
} else if (op.method === "deserialize") {
|
|
24431
24435
|
this.setAINodeShirkWidth();
|
|
24432
24436
|
this.updateElement();
|
|
@@ -38369,23 +38373,24 @@ class AINode extends BaseItem {
|
|
|
38369
38373
|
this.linkTo = new LinkTo(this.id, this.board.events);
|
|
38370
38374
|
this.text = new RichText(this.board, new Mbr, this.id, this.transformation, this.linkTo, " ", false, false, "AINode");
|
|
38371
38375
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
38372
|
-
if (op.method === "
|
|
38373
|
-
|
|
38376
|
+
if (op.method === "applyMatrix") {
|
|
38377
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
38378
|
+
this.prevMbr = this.path?.getMbr();
|
|
38379
|
+
this.text.handleInshapeScale();
|
|
38380
|
+
} else {
|
|
38381
|
+
this.text.transformCanvas();
|
|
38382
|
+
}
|
|
38374
38383
|
} else if (op.method === "transformMany") {
|
|
38375
38384
|
const currItemOp = op.items[this.getId()];
|
|
38376
38385
|
this.prevMbr = this.path?.getMbr();
|
|
38377
|
-
if (currItemOp.method === "
|
|
38386
|
+
if (currItemOp.method === "applyMatrix" && currItemOp.matrix.scaleX === 1 && currItemOp.matrix.scaleY === 1) {
|
|
38378
38387
|
this.text.transformCanvas();
|
|
38379
38388
|
} else {
|
|
38380
38389
|
this.text.handleInshapeScale();
|
|
38381
38390
|
}
|
|
38382
38391
|
} else {
|
|
38383
38392
|
this.prevMbr = this.path?.getMbr();
|
|
38384
|
-
|
|
38385
|
-
this.text.handleInshapeScale();
|
|
38386
|
-
} else {
|
|
38387
|
-
this.text.updateElement();
|
|
38388
|
-
}
|
|
38393
|
+
this.text.updateElement();
|
|
38389
38394
|
}
|
|
38390
38395
|
this.transformPath();
|
|
38391
38396
|
this.subject.publish(this);
|
|
@@ -41890,7 +41895,7 @@ class Shape extends BaseItem {
|
|
|
41890
41895
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
41891
41896
|
this.transformPath();
|
|
41892
41897
|
this.updateMbr();
|
|
41893
|
-
if (op.method === "
|
|
41898
|
+
if (op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
41894
41899
|
this.text.transformCanvas();
|
|
41895
41900
|
} else {
|
|
41896
41901
|
this.text.updateElement();
|
|
@@ -42417,21 +42422,21 @@ class Sticker extends BaseItem {
|
|
|
42417
42422
|
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
|
|
42418
42423
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
42419
42424
|
this.transformPath();
|
|
42420
|
-
if (op.method === "
|
|
42421
|
-
|
|
42422
|
-
|
|
42423
|
-
|
|
42424
|
-
|
|
42425
|
-
|
|
42426
|
-
|
|
42427
|
-
|
|
42428
|
-
|
|
42425
|
+
if (op.method === "applyMatrix") {
|
|
42426
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
42427
|
+
if (this.text.isAutosize()) {
|
|
42428
|
+
this.text.scaleAutoSizeScale(Math.min(op.matrix.scaleX, op.matrix.scaleY));
|
|
42429
|
+
this.text.recoordinate();
|
|
42430
|
+
this.text.transformCanvas();
|
|
42431
|
+
} else {
|
|
42432
|
+
this.text.handleInshapeScale();
|
|
42433
|
+
}
|
|
42429
42434
|
}
|
|
42430
42435
|
} else if (op.method === "transformMany") {
|
|
42431
42436
|
const transformOp = op.items[this.id];
|
|
42432
|
-
if (transformOp.method === "
|
|
42437
|
+
if (transformOp.method === "applyMatrix" && (transformOp.matrix.scaleX !== 1 || transformOp.matrix.scaleY !== 1)) {
|
|
42433
42438
|
if (this.text.isAutosize()) {
|
|
42434
|
-
this.text.scaleAutoSizeScale(Math.min(transformOp.
|
|
42439
|
+
this.text.scaleAutoSizeScale(Math.min(transformOp.matrix.scaleX, transformOp.matrix.scaleY));
|
|
42435
42440
|
this.text.recoordinate();
|
|
42436
42441
|
this.text.transformCanvas();
|
|
42437
42442
|
} else {
|
|
@@ -50526,7 +50531,7 @@ class Card extends BaseItem {
|
|
|
50526
50531
|
this.board.bringToFront(this);
|
|
50527
50532
|
}, 1000);
|
|
50528
50533
|
this.transformation.subject.subscribe((_, op) => {
|
|
50529
|
-
if (this.parent === "Board" && op.method === "
|
|
50534
|
+
if (this.parent === "Board" && op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
50530
50535
|
this.throttledBringToFront();
|
|
50531
50536
|
}
|
|
50532
50537
|
this.updateMbr();
|
|
@@ -57529,34 +57534,45 @@ function mergeItems(opA, opB) {
|
|
|
57529
57534
|
};
|
|
57530
57535
|
} else if (opA.items[itemId].method === "scaleByTranslateBy") {
|
|
57531
57536
|
const newTransformation = resolve2(opA.items[itemId].scale, opA.items[itemId].translate, opB.items[itemId]);
|
|
57532
|
-
|
|
57533
|
-
|
|
57534
|
-
|
|
57535
|
-
|
|
57536
|
-
|
|
57537
|
-
|
|
57538
|
-
|
|
57539
|
-
|
|
57540
|
-
|
|
57541
|
-
|
|
57537
|
+
if (!newTransformation) {
|
|
57538
|
+
items[itemId] = opB.items[itemId];
|
|
57539
|
+
} else {
|
|
57540
|
+
items[itemId] = {
|
|
57541
|
+
class: "Transformation",
|
|
57542
|
+
method: "scaleByTranslateBy",
|
|
57543
|
+
item: [itemId],
|
|
57544
|
+
scale: newTransformation.scale,
|
|
57545
|
+
translate: newTransformation.translate
|
|
57546
|
+
};
|
|
57547
|
+
}
|
|
57542
57548
|
} else if (opA.items[itemId].method === "scaleBy") {
|
|
57543
57549
|
const newTransformation = resolve2({ x: opA.items[itemId].x, y: opA.items[itemId].y }, undefined, opB.items[itemId]);
|
|
57544
|
-
|
|
57545
|
-
|
|
57546
|
-
|
|
57547
|
-
|
|
57548
|
-
|
|
57549
|
-
|
|
57550
|
-
|
|
57550
|
+
if (!newTransformation) {
|
|
57551
|
+
items[itemId] = opB.items[itemId];
|
|
57552
|
+
} else {
|
|
57553
|
+
items[itemId] = {
|
|
57554
|
+
class: "Transformation",
|
|
57555
|
+
method: "scaleByTranslateBy",
|
|
57556
|
+
item: [itemId],
|
|
57557
|
+
scale: newTransformation.scale,
|
|
57558
|
+
translate: newTransformation.translate
|
|
57559
|
+
};
|
|
57560
|
+
}
|
|
57551
57561
|
} else if (opA.items[itemId].method === "translateBy") {
|
|
57552
57562
|
const newTransformation = resolve2(undefined, { x: opA.items[itemId].x, y: opA.items[itemId].y }, opB.items[itemId]);
|
|
57553
|
-
|
|
57554
|
-
|
|
57555
|
-
|
|
57556
|
-
|
|
57557
|
-
|
|
57558
|
-
|
|
57559
|
-
|
|
57563
|
+
if (!newTransformation) {
|
|
57564
|
+
items[itemId] = opB.items[itemId];
|
|
57565
|
+
} else {
|
|
57566
|
+
items[itemId] = {
|
|
57567
|
+
class: "Transformation",
|
|
57568
|
+
method: "scaleByTranslateBy",
|
|
57569
|
+
item: [itemId],
|
|
57570
|
+
scale: newTransformation.scale,
|
|
57571
|
+
translate: newTransformation.translate
|
|
57572
|
+
};
|
|
57573
|
+
}
|
|
57574
|
+
} else {
|
|
57575
|
+
items[itemId] = opB.items[itemId];
|
|
57560
57576
|
}
|
|
57561
57577
|
} else {
|
|
57562
57578
|
items[itemId] = opB.items[itemId];
|
package/dist/esm/browser.js
CHANGED
|
@@ -21789,15 +21789,19 @@ class RichText extends BaseItem {
|
|
|
21789
21789
|
});
|
|
21790
21790
|
this.transformation.subject.subscribe((tr, op) => {
|
|
21791
21791
|
this.prevMbr = this.getMbr();
|
|
21792
|
-
if (op.method === "
|
|
21793
|
-
|
|
21794
|
-
|
|
21795
|
-
|
|
21796
|
-
|
|
21797
|
-
|
|
21792
|
+
if (op.method === "applyMatrix") {
|
|
21793
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
21794
|
+
this.setAINodeShirkWidth();
|
|
21795
|
+
if (!this.isInShape) {
|
|
21796
|
+
this.transformCanvas();
|
|
21797
|
+
} else {
|
|
21798
|
+
this.updateElement();
|
|
21799
|
+
}
|
|
21798
21800
|
} else {
|
|
21799
|
-
this.
|
|
21801
|
+
this.transformCanvas();
|
|
21800
21802
|
}
|
|
21803
|
+
} else if (op.method === "transformMany") {
|
|
21804
|
+
this.transformCanvas();
|
|
21801
21805
|
} else if (op.method === "deserialize") {
|
|
21802
21806
|
this.setAINodeShirkWidth();
|
|
21803
21807
|
this.updateElement();
|
|
@@ -35739,23 +35743,24 @@ class AINode extends BaseItem {
|
|
|
35739
35743
|
this.linkTo = new LinkTo(this.id, this.board.events);
|
|
35740
35744
|
this.text = new RichText(this.board, new Mbr, this.id, this.transformation, this.linkTo, " ", false, false, "AINode");
|
|
35741
35745
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
35742
|
-
if (op.method === "
|
|
35743
|
-
|
|
35746
|
+
if (op.method === "applyMatrix") {
|
|
35747
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
35748
|
+
this.prevMbr = this.path?.getMbr();
|
|
35749
|
+
this.text.handleInshapeScale();
|
|
35750
|
+
} else {
|
|
35751
|
+
this.text.transformCanvas();
|
|
35752
|
+
}
|
|
35744
35753
|
} else if (op.method === "transformMany") {
|
|
35745
35754
|
const currItemOp = op.items[this.getId()];
|
|
35746
35755
|
this.prevMbr = this.path?.getMbr();
|
|
35747
|
-
if (currItemOp.method === "
|
|
35756
|
+
if (currItemOp.method === "applyMatrix" && currItemOp.matrix.scaleX === 1 && currItemOp.matrix.scaleY === 1) {
|
|
35748
35757
|
this.text.transformCanvas();
|
|
35749
35758
|
} else {
|
|
35750
35759
|
this.text.handleInshapeScale();
|
|
35751
35760
|
}
|
|
35752
35761
|
} else {
|
|
35753
35762
|
this.prevMbr = this.path?.getMbr();
|
|
35754
|
-
|
|
35755
|
-
this.text.handleInshapeScale();
|
|
35756
|
-
} else {
|
|
35757
|
-
this.text.updateElement();
|
|
35758
|
-
}
|
|
35763
|
+
this.text.updateElement();
|
|
35759
35764
|
}
|
|
35760
35765
|
this.transformPath();
|
|
35761
35766
|
this.subject.publish(this);
|
|
@@ -39260,7 +39265,7 @@ class Shape extends BaseItem {
|
|
|
39260
39265
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
39261
39266
|
this.transformPath();
|
|
39262
39267
|
this.updateMbr();
|
|
39263
|
-
if (op.method === "
|
|
39268
|
+
if (op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
39264
39269
|
this.text.transformCanvas();
|
|
39265
39270
|
} else {
|
|
39266
39271
|
this.text.updateElement();
|
|
@@ -39787,21 +39792,21 @@ class Sticker extends BaseItem {
|
|
|
39787
39792
|
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
|
|
39788
39793
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
39789
39794
|
this.transformPath();
|
|
39790
|
-
if (op.method === "
|
|
39791
|
-
|
|
39792
|
-
|
|
39793
|
-
|
|
39794
|
-
|
|
39795
|
-
|
|
39796
|
-
|
|
39797
|
-
|
|
39798
|
-
|
|
39795
|
+
if (op.method === "applyMatrix") {
|
|
39796
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
39797
|
+
if (this.text.isAutosize()) {
|
|
39798
|
+
this.text.scaleAutoSizeScale(Math.min(op.matrix.scaleX, op.matrix.scaleY));
|
|
39799
|
+
this.text.recoordinate();
|
|
39800
|
+
this.text.transformCanvas();
|
|
39801
|
+
} else {
|
|
39802
|
+
this.text.handleInshapeScale();
|
|
39803
|
+
}
|
|
39799
39804
|
}
|
|
39800
39805
|
} else if (op.method === "transformMany") {
|
|
39801
39806
|
const transformOp = op.items[this.id];
|
|
39802
|
-
if (transformOp.method === "
|
|
39807
|
+
if (transformOp.method === "applyMatrix" && (transformOp.matrix.scaleX !== 1 || transformOp.matrix.scaleY !== 1)) {
|
|
39803
39808
|
if (this.text.isAutosize()) {
|
|
39804
|
-
this.text.scaleAutoSizeScale(Math.min(transformOp.
|
|
39809
|
+
this.text.scaleAutoSizeScale(Math.min(transformOp.matrix.scaleX, transformOp.matrix.scaleY));
|
|
39805
39810
|
this.text.recoordinate();
|
|
39806
39811
|
this.text.transformCanvas();
|
|
39807
39812
|
} else {
|
|
@@ -47896,7 +47901,7 @@ class Card extends BaseItem {
|
|
|
47896
47901
|
this.board.bringToFront(this);
|
|
47897
47902
|
}, 1000);
|
|
47898
47903
|
this.transformation.subject.subscribe((_, op) => {
|
|
47899
|
-
if (this.parent === "Board" && op.method === "
|
|
47904
|
+
if (this.parent === "Board" && op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
47900
47905
|
this.throttledBringToFront();
|
|
47901
47906
|
}
|
|
47902
47907
|
this.updateMbr();
|
|
@@ -54899,34 +54904,45 @@ function mergeItems(opA, opB) {
|
|
|
54899
54904
|
};
|
|
54900
54905
|
} else if (opA.items[itemId].method === "scaleByTranslateBy") {
|
|
54901
54906
|
const newTransformation = resolve2(opA.items[itemId].scale, opA.items[itemId].translate, opB.items[itemId]);
|
|
54902
|
-
|
|
54903
|
-
|
|
54904
|
-
|
|
54905
|
-
|
|
54906
|
-
|
|
54907
|
-
|
|
54908
|
-
|
|
54909
|
-
|
|
54910
|
-
|
|
54911
|
-
|
|
54907
|
+
if (!newTransformation) {
|
|
54908
|
+
items[itemId] = opB.items[itemId];
|
|
54909
|
+
} else {
|
|
54910
|
+
items[itemId] = {
|
|
54911
|
+
class: "Transformation",
|
|
54912
|
+
method: "scaleByTranslateBy",
|
|
54913
|
+
item: [itemId],
|
|
54914
|
+
scale: newTransformation.scale,
|
|
54915
|
+
translate: newTransformation.translate
|
|
54916
|
+
};
|
|
54917
|
+
}
|
|
54912
54918
|
} else if (opA.items[itemId].method === "scaleBy") {
|
|
54913
54919
|
const newTransformation = resolve2({ x: opA.items[itemId].x, y: opA.items[itemId].y }, undefined, opB.items[itemId]);
|
|
54914
|
-
|
|
54915
|
-
|
|
54916
|
-
|
|
54917
|
-
|
|
54918
|
-
|
|
54919
|
-
|
|
54920
|
-
|
|
54920
|
+
if (!newTransformation) {
|
|
54921
|
+
items[itemId] = opB.items[itemId];
|
|
54922
|
+
} else {
|
|
54923
|
+
items[itemId] = {
|
|
54924
|
+
class: "Transformation",
|
|
54925
|
+
method: "scaleByTranslateBy",
|
|
54926
|
+
item: [itemId],
|
|
54927
|
+
scale: newTransformation.scale,
|
|
54928
|
+
translate: newTransformation.translate
|
|
54929
|
+
};
|
|
54930
|
+
}
|
|
54921
54931
|
} else if (opA.items[itemId].method === "translateBy") {
|
|
54922
54932
|
const newTransformation = resolve2(undefined, { x: opA.items[itemId].x, y: opA.items[itemId].y }, opB.items[itemId]);
|
|
54923
|
-
|
|
54924
|
-
|
|
54925
|
-
|
|
54926
|
-
|
|
54927
|
-
|
|
54928
|
-
|
|
54929
|
-
|
|
54933
|
+
if (!newTransformation) {
|
|
54934
|
+
items[itemId] = opB.items[itemId];
|
|
54935
|
+
} else {
|
|
54936
|
+
items[itemId] = {
|
|
54937
|
+
class: "Transformation",
|
|
54938
|
+
method: "scaleByTranslateBy",
|
|
54939
|
+
item: [itemId],
|
|
54940
|
+
scale: newTransformation.scale,
|
|
54941
|
+
translate: newTransformation.translate
|
|
54942
|
+
};
|
|
54943
|
+
}
|
|
54944
|
+
} else {
|
|
54945
|
+
items[itemId] = opB.items[itemId];
|
|
54930
54946
|
}
|
|
54931
54947
|
} else {
|
|
54932
54948
|
items[itemId] = opB.items[itemId];
|
package/dist/esm/index.js
CHANGED
|
@@ -21782,15 +21782,19 @@ class RichText extends BaseItem {
|
|
|
21782
21782
|
});
|
|
21783
21783
|
this.transformation.subject.subscribe((tr, op) => {
|
|
21784
21784
|
this.prevMbr = this.getMbr();
|
|
21785
|
-
if (op.method === "
|
|
21786
|
-
|
|
21787
|
-
|
|
21788
|
-
|
|
21789
|
-
|
|
21790
|
-
|
|
21785
|
+
if (op.method === "applyMatrix") {
|
|
21786
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
21787
|
+
this.setAINodeShirkWidth();
|
|
21788
|
+
if (!this.isInShape) {
|
|
21789
|
+
this.transformCanvas();
|
|
21790
|
+
} else {
|
|
21791
|
+
this.updateElement();
|
|
21792
|
+
}
|
|
21791
21793
|
} else {
|
|
21792
|
-
this.
|
|
21794
|
+
this.transformCanvas();
|
|
21793
21795
|
}
|
|
21796
|
+
} else if (op.method === "transformMany") {
|
|
21797
|
+
this.transformCanvas();
|
|
21794
21798
|
} else if (op.method === "deserialize") {
|
|
21795
21799
|
this.setAINodeShirkWidth();
|
|
21796
21800
|
this.updateElement();
|
|
@@ -35732,23 +35736,24 @@ class AINode extends BaseItem {
|
|
|
35732
35736
|
this.linkTo = new LinkTo(this.id, this.board.events);
|
|
35733
35737
|
this.text = new RichText(this.board, new Mbr, this.id, this.transformation, this.linkTo, " ", false, false, "AINode");
|
|
35734
35738
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
35735
|
-
if (op.method === "
|
|
35736
|
-
|
|
35739
|
+
if (op.method === "applyMatrix") {
|
|
35740
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
35741
|
+
this.prevMbr = this.path?.getMbr();
|
|
35742
|
+
this.text.handleInshapeScale();
|
|
35743
|
+
} else {
|
|
35744
|
+
this.text.transformCanvas();
|
|
35745
|
+
}
|
|
35737
35746
|
} else if (op.method === "transformMany") {
|
|
35738
35747
|
const currItemOp = op.items[this.getId()];
|
|
35739
35748
|
this.prevMbr = this.path?.getMbr();
|
|
35740
|
-
if (currItemOp.method === "
|
|
35749
|
+
if (currItemOp.method === "applyMatrix" && currItemOp.matrix.scaleX === 1 && currItemOp.matrix.scaleY === 1) {
|
|
35741
35750
|
this.text.transformCanvas();
|
|
35742
35751
|
} else {
|
|
35743
35752
|
this.text.handleInshapeScale();
|
|
35744
35753
|
}
|
|
35745
35754
|
} else {
|
|
35746
35755
|
this.prevMbr = this.path?.getMbr();
|
|
35747
|
-
|
|
35748
|
-
this.text.handleInshapeScale();
|
|
35749
|
-
} else {
|
|
35750
|
-
this.text.updateElement();
|
|
35751
|
-
}
|
|
35756
|
+
this.text.updateElement();
|
|
35752
35757
|
}
|
|
35753
35758
|
this.transformPath();
|
|
35754
35759
|
this.subject.publish(this);
|
|
@@ -39253,7 +39258,7 @@ class Shape extends BaseItem {
|
|
|
39253
39258
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
39254
39259
|
this.transformPath();
|
|
39255
39260
|
this.updateMbr();
|
|
39256
|
-
if (op.method === "
|
|
39261
|
+
if (op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
39257
39262
|
this.text.transformCanvas();
|
|
39258
39263
|
} else {
|
|
39259
39264
|
this.text.updateElement();
|
|
@@ -39780,21 +39785,21 @@ class Sticker extends BaseItem {
|
|
|
39780
39785
|
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
|
|
39781
39786
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
39782
39787
|
this.transformPath();
|
|
39783
|
-
if (op.method === "
|
|
39784
|
-
|
|
39785
|
-
|
|
39786
|
-
|
|
39787
|
-
|
|
39788
|
-
|
|
39789
|
-
|
|
39790
|
-
|
|
39791
|
-
|
|
39788
|
+
if (op.method === "applyMatrix") {
|
|
39789
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
39790
|
+
if (this.text.isAutosize()) {
|
|
39791
|
+
this.text.scaleAutoSizeScale(Math.min(op.matrix.scaleX, op.matrix.scaleY));
|
|
39792
|
+
this.text.recoordinate();
|
|
39793
|
+
this.text.transformCanvas();
|
|
39794
|
+
} else {
|
|
39795
|
+
this.text.handleInshapeScale();
|
|
39796
|
+
}
|
|
39792
39797
|
}
|
|
39793
39798
|
} else if (op.method === "transformMany") {
|
|
39794
39799
|
const transformOp = op.items[this.id];
|
|
39795
|
-
if (transformOp.method === "
|
|
39800
|
+
if (transformOp.method === "applyMatrix" && (transformOp.matrix.scaleX !== 1 || transformOp.matrix.scaleY !== 1)) {
|
|
39796
39801
|
if (this.text.isAutosize()) {
|
|
39797
|
-
this.text.scaleAutoSizeScale(Math.min(transformOp.
|
|
39802
|
+
this.text.scaleAutoSizeScale(Math.min(transformOp.matrix.scaleX, transformOp.matrix.scaleY));
|
|
39798
39803
|
this.text.recoordinate();
|
|
39799
39804
|
this.text.transformCanvas();
|
|
39800
39805
|
} else {
|
|
@@ -47889,7 +47894,7 @@ class Card extends BaseItem {
|
|
|
47889
47894
|
this.board.bringToFront(this);
|
|
47890
47895
|
}, 1000);
|
|
47891
47896
|
this.transformation.subject.subscribe((_, op) => {
|
|
47892
|
-
if (this.parent === "Board" && op.method === "
|
|
47897
|
+
if (this.parent === "Board" && op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
47893
47898
|
this.throttledBringToFront();
|
|
47894
47899
|
}
|
|
47895
47900
|
this.updateMbr();
|
|
@@ -54892,34 +54897,45 @@ function mergeItems(opA, opB) {
|
|
|
54892
54897
|
};
|
|
54893
54898
|
} else if (opA.items[itemId].method === "scaleByTranslateBy") {
|
|
54894
54899
|
const newTransformation = resolve2(opA.items[itemId].scale, opA.items[itemId].translate, opB.items[itemId]);
|
|
54895
|
-
|
|
54896
|
-
|
|
54897
|
-
|
|
54898
|
-
|
|
54899
|
-
|
|
54900
|
-
|
|
54901
|
-
|
|
54902
|
-
|
|
54903
|
-
|
|
54904
|
-
|
|
54900
|
+
if (!newTransformation) {
|
|
54901
|
+
items[itemId] = opB.items[itemId];
|
|
54902
|
+
} else {
|
|
54903
|
+
items[itemId] = {
|
|
54904
|
+
class: "Transformation",
|
|
54905
|
+
method: "scaleByTranslateBy",
|
|
54906
|
+
item: [itemId],
|
|
54907
|
+
scale: newTransformation.scale,
|
|
54908
|
+
translate: newTransformation.translate
|
|
54909
|
+
};
|
|
54910
|
+
}
|
|
54905
54911
|
} else if (opA.items[itemId].method === "scaleBy") {
|
|
54906
54912
|
const newTransformation = resolve2({ x: opA.items[itemId].x, y: opA.items[itemId].y }, undefined, opB.items[itemId]);
|
|
54907
|
-
|
|
54908
|
-
|
|
54909
|
-
|
|
54910
|
-
|
|
54911
|
-
|
|
54912
|
-
|
|
54913
|
-
|
|
54913
|
+
if (!newTransformation) {
|
|
54914
|
+
items[itemId] = opB.items[itemId];
|
|
54915
|
+
} else {
|
|
54916
|
+
items[itemId] = {
|
|
54917
|
+
class: "Transformation",
|
|
54918
|
+
method: "scaleByTranslateBy",
|
|
54919
|
+
item: [itemId],
|
|
54920
|
+
scale: newTransformation.scale,
|
|
54921
|
+
translate: newTransformation.translate
|
|
54922
|
+
};
|
|
54923
|
+
}
|
|
54914
54924
|
} else if (opA.items[itemId].method === "translateBy") {
|
|
54915
54925
|
const newTransformation = resolve2(undefined, { x: opA.items[itemId].x, y: opA.items[itemId].y }, opB.items[itemId]);
|
|
54916
|
-
|
|
54917
|
-
|
|
54918
|
-
|
|
54919
|
-
|
|
54920
|
-
|
|
54921
|
-
|
|
54922
|
-
|
|
54926
|
+
if (!newTransformation) {
|
|
54927
|
+
items[itemId] = opB.items[itemId];
|
|
54928
|
+
} else {
|
|
54929
|
+
items[itemId] = {
|
|
54930
|
+
class: "Transformation",
|
|
54931
|
+
method: "scaleByTranslateBy",
|
|
54932
|
+
item: [itemId],
|
|
54933
|
+
scale: newTransformation.scale,
|
|
54934
|
+
translate: newTransformation.translate
|
|
54935
|
+
};
|
|
54936
|
+
}
|
|
54937
|
+
} else {
|
|
54938
|
+
items[itemId] = opB.items[itemId];
|
|
54923
54939
|
}
|
|
54924
54940
|
} else {
|
|
54925
54941
|
items[itemId] = opB.items[itemId];
|
package/dist/esm/node.js
CHANGED
|
@@ -24249,15 +24249,19 @@ class RichText extends BaseItem {
|
|
|
24249
24249
|
});
|
|
24250
24250
|
this.transformation.subject.subscribe((tr, op) => {
|
|
24251
24251
|
this.prevMbr = this.getMbr();
|
|
24252
|
-
if (op.method === "
|
|
24253
|
-
|
|
24254
|
-
|
|
24255
|
-
|
|
24256
|
-
|
|
24257
|
-
|
|
24252
|
+
if (op.method === "applyMatrix") {
|
|
24253
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
24254
|
+
this.setAINodeShirkWidth();
|
|
24255
|
+
if (!this.isInShape) {
|
|
24256
|
+
this.transformCanvas();
|
|
24257
|
+
} else {
|
|
24258
|
+
this.updateElement();
|
|
24259
|
+
}
|
|
24258
24260
|
} else {
|
|
24259
|
-
this.
|
|
24261
|
+
this.transformCanvas();
|
|
24260
24262
|
}
|
|
24263
|
+
} else if (op.method === "transformMany") {
|
|
24264
|
+
this.transformCanvas();
|
|
24261
24265
|
} else if (op.method === "deserialize") {
|
|
24262
24266
|
this.setAINodeShirkWidth();
|
|
24263
24267
|
this.updateElement();
|
|
@@ -38200,23 +38204,24 @@ class AINode extends BaseItem {
|
|
|
38200
38204
|
this.linkTo = new LinkTo(this.id, this.board.events);
|
|
38201
38205
|
this.text = new RichText(this.board, new Mbr, this.id, this.transformation, this.linkTo, " ", false, false, "AINode");
|
|
38202
38206
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
38203
|
-
if (op.method === "
|
|
38204
|
-
|
|
38207
|
+
if (op.method === "applyMatrix") {
|
|
38208
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
38209
|
+
this.prevMbr = this.path?.getMbr();
|
|
38210
|
+
this.text.handleInshapeScale();
|
|
38211
|
+
} else {
|
|
38212
|
+
this.text.transformCanvas();
|
|
38213
|
+
}
|
|
38205
38214
|
} else if (op.method === "transformMany") {
|
|
38206
38215
|
const currItemOp = op.items[this.getId()];
|
|
38207
38216
|
this.prevMbr = this.path?.getMbr();
|
|
38208
|
-
if (currItemOp.method === "
|
|
38217
|
+
if (currItemOp.method === "applyMatrix" && currItemOp.matrix.scaleX === 1 && currItemOp.matrix.scaleY === 1) {
|
|
38209
38218
|
this.text.transformCanvas();
|
|
38210
38219
|
} else {
|
|
38211
38220
|
this.text.handleInshapeScale();
|
|
38212
38221
|
}
|
|
38213
38222
|
} else {
|
|
38214
38223
|
this.prevMbr = this.path?.getMbr();
|
|
38215
|
-
|
|
38216
|
-
this.text.handleInshapeScale();
|
|
38217
|
-
} else {
|
|
38218
|
-
this.text.updateElement();
|
|
38219
|
-
}
|
|
38224
|
+
this.text.updateElement();
|
|
38220
38225
|
}
|
|
38221
38226
|
this.transformPath();
|
|
38222
38227
|
this.subject.publish(this);
|
|
@@ -41721,7 +41726,7 @@ class Shape extends BaseItem {
|
|
|
41721
41726
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
41722
41727
|
this.transformPath();
|
|
41723
41728
|
this.updateMbr();
|
|
41724
|
-
if (op.method === "
|
|
41729
|
+
if (op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
41725
41730
|
this.text.transformCanvas();
|
|
41726
41731
|
} else {
|
|
41727
41732
|
this.text.updateElement();
|
|
@@ -42248,21 +42253,21 @@ class Sticker extends BaseItem {
|
|
|
42248
42253
|
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
|
|
42249
42254
|
this.transformation.subject.subscribe((_subject, op) => {
|
|
42250
42255
|
this.transformPath();
|
|
42251
|
-
if (op.method === "
|
|
42252
|
-
|
|
42253
|
-
|
|
42254
|
-
|
|
42255
|
-
|
|
42256
|
-
|
|
42257
|
-
|
|
42258
|
-
|
|
42259
|
-
|
|
42256
|
+
if (op.method === "applyMatrix") {
|
|
42257
|
+
if (op.matrix.scaleX !== 1 || op.matrix.scaleY !== 1) {
|
|
42258
|
+
if (this.text.isAutosize()) {
|
|
42259
|
+
this.text.scaleAutoSizeScale(Math.min(op.matrix.scaleX, op.matrix.scaleY));
|
|
42260
|
+
this.text.recoordinate();
|
|
42261
|
+
this.text.transformCanvas();
|
|
42262
|
+
} else {
|
|
42263
|
+
this.text.handleInshapeScale();
|
|
42264
|
+
}
|
|
42260
42265
|
}
|
|
42261
42266
|
} else if (op.method === "transformMany") {
|
|
42262
42267
|
const transformOp = op.items[this.id];
|
|
42263
|
-
if (transformOp.method === "
|
|
42268
|
+
if (transformOp.method === "applyMatrix" && (transformOp.matrix.scaleX !== 1 || transformOp.matrix.scaleY !== 1)) {
|
|
42264
42269
|
if (this.text.isAutosize()) {
|
|
42265
|
-
this.text.scaleAutoSizeScale(Math.min(transformOp.
|
|
42270
|
+
this.text.scaleAutoSizeScale(Math.min(transformOp.matrix.scaleX, transformOp.matrix.scaleY));
|
|
42266
42271
|
this.text.recoordinate();
|
|
42267
42272
|
this.text.transformCanvas();
|
|
42268
42273
|
} else {
|
|
@@ -50357,7 +50362,7 @@ class Card extends BaseItem {
|
|
|
50357
50362
|
this.board.bringToFront(this);
|
|
50358
50363
|
}, 1000);
|
|
50359
50364
|
this.transformation.subject.subscribe((_, op) => {
|
|
50360
|
-
if (this.parent === "Board" && op.method === "
|
|
50365
|
+
if (this.parent === "Board" && op.method === "applyMatrix" && op.matrix.scaleX === 1 && op.matrix.scaleY === 1) {
|
|
50361
50366
|
this.throttledBringToFront();
|
|
50362
50367
|
}
|
|
50363
50368
|
this.updateMbr();
|
|
@@ -57360,34 +57365,45 @@ function mergeItems(opA, opB) {
|
|
|
57360
57365
|
};
|
|
57361
57366
|
} else if (opA.items[itemId].method === "scaleByTranslateBy") {
|
|
57362
57367
|
const newTransformation = resolve2(opA.items[itemId].scale, opA.items[itemId].translate, opB.items[itemId]);
|
|
57363
|
-
|
|
57364
|
-
|
|
57365
|
-
|
|
57366
|
-
|
|
57367
|
-
|
|
57368
|
-
|
|
57369
|
-
|
|
57370
|
-
|
|
57371
|
-
|
|
57372
|
-
|
|
57368
|
+
if (!newTransformation) {
|
|
57369
|
+
items[itemId] = opB.items[itemId];
|
|
57370
|
+
} else {
|
|
57371
|
+
items[itemId] = {
|
|
57372
|
+
class: "Transformation",
|
|
57373
|
+
method: "scaleByTranslateBy",
|
|
57374
|
+
item: [itemId],
|
|
57375
|
+
scale: newTransformation.scale,
|
|
57376
|
+
translate: newTransformation.translate
|
|
57377
|
+
};
|
|
57378
|
+
}
|
|
57373
57379
|
} else if (opA.items[itemId].method === "scaleBy") {
|
|
57374
57380
|
const newTransformation = resolve2({ x: opA.items[itemId].x, y: opA.items[itemId].y }, undefined, opB.items[itemId]);
|
|
57375
|
-
|
|
57376
|
-
|
|
57377
|
-
|
|
57378
|
-
|
|
57379
|
-
|
|
57380
|
-
|
|
57381
|
-
|
|
57381
|
+
if (!newTransformation) {
|
|
57382
|
+
items[itemId] = opB.items[itemId];
|
|
57383
|
+
} else {
|
|
57384
|
+
items[itemId] = {
|
|
57385
|
+
class: "Transformation",
|
|
57386
|
+
method: "scaleByTranslateBy",
|
|
57387
|
+
item: [itemId],
|
|
57388
|
+
scale: newTransformation.scale,
|
|
57389
|
+
translate: newTransformation.translate
|
|
57390
|
+
};
|
|
57391
|
+
}
|
|
57382
57392
|
} else if (opA.items[itemId].method === "translateBy") {
|
|
57383
57393
|
const newTransformation = resolve2(undefined, { x: opA.items[itemId].x, y: opA.items[itemId].y }, opB.items[itemId]);
|
|
57384
|
-
|
|
57385
|
-
|
|
57386
|
-
|
|
57387
|
-
|
|
57388
|
-
|
|
57389
|
-
|
|
57390
|
-
|
|
57394
|
+
if (!newTransformation) {
|
|
57395
|
+
items[itemId] = opB.items[itemId];
|
|
57396
|
+
} else {
|
|
57397
|
+
items[itemId] = {
|
|
57398
|
+
class: "Transformation",
|
|
57399
|
+
method: "scaleByTranslateBy",
|
|
57400
|
+
item: [itemId],
|
|
57401
|
+
scale: newTransformation.scale,
|
|
57402
|
+
translate: newTransformation.translate
|
|
57403
|
+
};
|
|
57404
|
+
}
|
|
57405
|
+
} else {
|
|
57406
|
+
items[itemId] = opB.items[itemId];
|
|
57391
57407
|
}
|
|
57392
57408
|
} else {
|
|
57393
57409
|
items[itemId] = opB.items[itemId];
|