exodeui 2.6.4 → 2.6.6
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/index.js +1 -1
- package/dist/index.mjs +17 -15
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4642,7 +4642,7 @@ class KC {
|
|
|
4642
4642
|
return this.objectStates.get(A);
|
|
4643
4643
|
}
|
|
4644
4644
|
load(A) {
|
|
4645
|
-
this.artboard = A, this.reset(), this.advance(0);
|
|
4645
|
+
this.artboard = A, this.loadFonts(), this.reset(), this.advance(0);
|
|
4646
4646
|
}
|
|
4647
4647
|
reset() {
|
|
4648
4648
|
if (!this.artboard) return;
|
|
@@ -4671,9 +4671,8 @@ class KC {
|
|
|
4671
4671
|
this.physicsEngine.createBody({
|
|
4672
4672
|
id: C.id,
|
|
4673
4673
|
type: C.geometry.type,
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
y: i.y + o / 2,
|
|
4674
|
+
x: i.x,
|
|
4675
|
+
y: i.y,
|
|
4677
4676
|
width: D,
|
|
4678
4677
|
height: o,
|
|
4679
4678
|
rotation: i.rotation * (Math.PI / 180),
|
|
@@ -5122,24 +5121,27 @@ class KC {
|
|
|
5122
5121
|
console.warn("No state for object:", I.id);
|
|
5123
5122
|
return;
|
|
5124
5123
|
}
|
|
5125
|
-
const C = g.geometry || I.geometry, B = C.width || 0, i = C.height || 0, D = g.x
|
|
5124
|
+
const C = g.geometry || I.geometry, B = C.width || 0, i = C.height || 0, D = g.x, o = g.y;
|
|
5126
5125
|
A.save(), A.translate(D, o), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y);
|
|
5127
5126
|
const w = g.style || I.style;
|
|
5128
5127
|
if (C.type === "Text") {
|
|
5129
5128
|
let h = C.text;
|
|
5130
5129
|
if (C.textInputId) {
|
|
5131
|
-
const
|
|
5132
|
-
|
|
5130
|
+
const a = this.inputs.get(C.textInputId);
|
|
5131
|
+
a !== void 0 && (h = String(a), g.geometry && (g.geometry.text = h));
|
|
5133
5132
|
}
|
|
5134
|
-
const K = C.textAlign || C.align || "left"
|
|
5133
|
+
const K = C.textAlign || C.align || "left";
|
|
5135
5134
|
A.textAlign = K, A.textBaseline = "top";
|
|
5136
|
-
let
|
|
5137
|
-
K === "center" && (
|
|
5138
|
-
let
|
|
5139
|
-
const
|
|
5140
|
-
A.font = `${
|
|
5141
|
-
|
|
5142
|
-
|
|
5135
|
+
let s = -B / 2;
|
|
5136
|
+
K === "center" && (s = 0), K === "right" && (s = B / 2);
|
|
5137
|
+
let k = -i / 2;
|
|
5138
|
+
const M = C.fontWeight || "normal", F = C.fontStyle || "normal";
|
|
5139
|
+
if (A.font = `${F} ${M} ${C.fontSize}px "${C.fontFamily}"`, "letterSpacing" in A) {
|
|
5140
|
+
const a = C.letterSpacing !== void 0 ? `${C.letterSpacing}px` : "-0.5px";
|
|
5141
|
+
A.letterSpacing = a;
|
|
5142
|
+
}
|
|
5143
|
+
const y = B > 0 ? B : void 0;
|
|
5144
|
+
w.fill && (A.fillStyle = w.fill.color, A.globalAlpha = (g.opacity ?? 1) * (w.fill.opacity ?? 1), A.fillText(h, s, k, y)), w.stroke && w.stroke.width > 0 && (A.strokeStyle = w.stroke.color, A.lineWidth = w.stroke.width, A.globalAlpha = (g.opacity ?? 1) * (w.stroke.opacity ?? 1), A.strokeText(h, s, k, y)), "letterSpacing" in A && (A.letterSpacing = "0px");
|
|
5143
5145
|
} else if (C.type === "Image") {
|
|
5144
5146
|
const h = C.src;
|
|
5145
5147
|
if (h) {
|