exodeui 2.5.3 → 2.5.5
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/engine.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +25 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4667,12 +4667,12 @@ class KC {
|
|
|
4667
4667
|
if ((B = C.physics) != null && B.enabled && C.type === "Shape") {
|
|
4668
4668
|
const i = this.objectStates.get(C.id);
|
|
4669
4669
|
if (!i) return;
|
|
4670
|
-
const D = C.geometry.width || 100, o = C.geometry.height || 100;
|
|
4670
|
+
const D = C.geometry.width || 100, o = C.geometry.height || 100, w = i.x + D / 2, h = i.y + o / 2;
|
|
4671
4671
|
this.physicsEngine.createBody({
|
|
4672
4672
|
id: C.id,
|
|
4673
4673
|
type: C.geometry.type,
|
|
4674
|
-
x:
|
|
4675
|
-
y:
|
|
4674
|
+
x: w,
|
|
4675
|
+
y: h,
|
|
4676
4676
|
width: D,
|
|
4677
4677
|
height: o,
|
|
4678
4678
|
rotation: i.rotation * (Math.PI / 180),
|
|
@@ -4705,6 +4705,27 @@ class KC {
|
|
|
4705
4705
|
duration: I.duration
|
|
4706
4706
|
});
|
|
4707
4707
|
}
|
|
4708
|
+
this.loadFonts();
|
|
4709
|
+
}
|
|
4710
|
+
loadFonts() {
|
|
4711
|
+
if (!this.artboard) return;
|
|
4712
|
+
const A = /* @__PURE__ */ new Set();
|
|
4713
|
+
if (this.artboard.objects.forEach((C) => {
|
|
4714
|
+
C.geometry && C.geometry.type === "Text" && C.geometry.fontFamily && A.add(C.geometry.fontFamily);
|
|
4715
|
+
}), A.size === 0) return;
|
|
4716
|
+
let I = "";
|
|
4717
|
+
A.forEach((C) => {
|
|
4718
|
+
const B = C.replace(/ /g, "+");
|
|
4719
|
+
I += `&family=${B}:wght@400;700`;
|
|
4720
|
+
});
|
|
4721
|
+
const g = "exodeui-google-fonts";
|
|
4722
|
+
if (document.getElementById(g)) {
|
|
4723
|
+
const C = document.getElementById(g);
|
|
4724
|
+
C.href = `https://fonts.googleapis.com/css2?display=swap${I}`;
|
|
4725
|
+
} else {
|
|
4726
|
+
const C = document.createElement("link");
|
|
4727
|
+
C.id = g, C.rel = "stylesheet", C.href = `https://fonts.googleapis.com/css2?display=swap${I}`, document.head.appendChild(C);
|
|
4728
|
+
}
|
|
4708
4729
|
}
|
|
4709
4730
|
enterStates(A, I) {
|
|
4710
4731
|
if (I.length === 0) return;
|
|
@@ -5100,7 +5121,7 @@ class KC {
|
|
|
5100
5121
|
console.warn("No state for object:", I.id);
|
|
5101
5122
|
return;
|
|
5102
5123
|
}
|
|
5103
|
-
const C = g.geometry || I.geometry, B = C.width || 0, i = C.height || 0, D = g.x, o = g.y;
|
|
5124
|
+
const C = g.geometry || I.geometry, B = C.width || 0, i = C.height || 0, D = g.x + B / 2, o = g.y + i / 2;
|
|
5104
5125
|
A.save(), A.translate(D, o), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y);
|
|
5105
5126
|
const w = g.style || I.style;
|
|
5106
5127
|
if (C.type === "Text") {
|