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.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
- // FIX: Physics Engine expects Center coordinates, but stored state is Top-Left.
4675
- x: i.x + D / 2,
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 + B / 2, o = g.y + i / 2;
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 R = this.inputs.get(C.textInputId);
5132
- R !== void 0 && (h = String(R), g.geometry && (g.geometry.text = h));
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", s = C.width || 0;
5133
+ const K = C.textAlign || C.align || "left";
5135
5134
  A.textAlign = K, A.textBaseline = "top";
5136
- let k = -s / 2;
5137
- K === "center" && (k = 0), K === "right" && (k = s / 2);
5138
- let M = -i / 2;
5139
- const F = C.fontWeight || "normal", y = C.fontStyle || "normal";
5140
- A.font = `${y} ${F} ${C.fontSize}px "${C.fontFamily}"`, "letterSpacing" in A && C.letterSpacing && (A.letterSpacing = `${C.letterSpacing}px`);
5141
- const a = s > 0 ? s : void 0;
5142
- w.fill && (A.fillStyle = w.fill.color, A.globalAlpha = (g.opacity ?? 1) * (w.fill.opacity ?? 1), A.fillText(h, k, M, a)), 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, k, M, a)), "letterSpacing" in A && (A.letterSpacing = "0px");
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exodeui",
3
- "version": "2.6.4",
3
+ "version": "2.6.6",
4
4
  "description": "React Runtime for ExodeUI Animation Engine",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",