@meta2d/core 1.0.77 → 1.0.79
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/package.json +1 -1
- package/src/canvas/canvas.js +22 -2
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.js +18 -2
- package/src/core.js.map +1 -1
- package/src/pen/arrow.js +15 -0
- package/src/pen/arrow.js.map +1 -1
package/src/core.js
CHANGED
|
@@ -3936,7 +3936,7 @@ export class Meta2d {
|
|
|
3936
3936
|
else {
|
|
3937
3937
|
right = 0;
|
|
3938
3938
|
}
|
|
3939
|
-
let ratio = (this.canvas.width - left - right) / (rect.width
|
|
3939
|
+
let ratio = (this.canvas.width - left - right) / (rect.width);
|
|
3940
3940
|
pens.forEach((pen) => {
|
|
3941
3941
|
if (pen.image && pen.imageRatio) {
|
|
3942
3942
|
if (pen.calculative.worldRect.width / this.canvas.width > 0.1) {
|
|
@@ -3959,6 +3959,14 @@ export class Meta2d {
|
|
|
3959
3959
|
if (pen.externElement) {
|
|
3960
3960
|
pen.onResize?.(pen);
|
|
3961
3961
|
}
|
|
3962
|
+
if (pen.children.length) {
|
|
3963
|
+
const cPens = getAllChildren(pen, this.store);
|
|
3964
|
+
cPens.forEach((cPen) => {
|
|
3965
|
+
if (cPen.externElement) {
|
|
3966
|
+
cPen.onResize?.(cPen);
|
|
3967
|
+
}
|
|
3968
|
+
});
|
|
3969
|
+
}
|
|
3962
3970
|
});
|
|
3963
3971
|
}
|
|
3964
3972
|
else if (fit.left) {
|
|
@@ -4032,7 +4040,7 @@ export class Meta2d {
|
|
|
4032
4040
|
else {
|
|
4033
4041
|
bottom = 0;
|
|
4034
4042
|
}
|
|
4035
|
-
let ratio = (this.canvas.height - top - bottom) / (rect.height
|
|
4043
|
+
let ratio = (this.canvas.height - top - bottom) / (rect.height);
|
|
4036
4044
|
pens.forEach((pen) => {
|
|
4037
4045
|
if (pen.image && pen.imageRatio) {
|
|
4038
4046
|
if (pen.calculative.worldRect.height / this.canvas.height > 0.1) {
|
|
@@ -4055,6 +4063,14 @@ export class Meta2d {
|
|
|
4055
4063
|
if (pen.externElement) {
|
|
4056
4064
|
pen.onResize?.(pen);
|
|
4057
4065
|
}
|
|
4066
|
+
if (pen.children?.length) {
|
|
4067
|
+
const cPens = getAllChildren(pen, this.store);
|
|
4068
|
+
cPens.forEach((cPen) => {
|
|
4069
|
+
if (cPen.externElement) {
|
|
4070
|
+
cPen.onResize?.(cPen);
|
|
4071
|
+
}
|
|
4072
|
+
});
|
|
4073
|
+
}
|
|
4058
4074
|
});
|
|
4059
4075
|
}
|
|
4060
4076
|
else if (fit.top) {
|