modern-canvas 0.24.4 → 0.24.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.
Files changed (2) hide show
  1. package/dist/index.js +17 -17
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -758,7 +758,7 @@ function O(e, t, n) {
758
758
  //#endregion
759
759
  //#region src/core/math/ColorMatrix.ts
760
760
  var St = class {
761
- _array = new Float32Array(20);
761
+ _array = /* @__PURE__ */ new Float32Array(20);
762
762
  constructor() {
763
763
  this.identity();
764
764
  }
@@ -1085,18 +1085,18 @@ var St = class {
1085
1085
  return this.width = e, this.height = t, this;
1086
1086
  }
1087
1087
  toArray(e, t) {
1088
- this._array ||= new Float32Array(9);
1088
+ this._array ||= /* @__PURE__ */ new Float32Array(9);
1089
1089
  let n = t || this._array, r = this.flip ? -1 : 1, i = 1 / this.width * 2, a = r * (1 / this.height * 2), o = -1 - this.x * i, s = -r - this.y * a;
1090
1090
  return e ? (n[0] = i, n[1] = 0, n[2] = 0, n[3] = 0, n[4] = a, n[5] = 0, n[6] = o, n[7] = s, n[8] = 1) : (n[0] = i, n[1] = 0, n[2] = o, n[3] = 0, n[4] = a, n[5] = s, n[6] = 0, n[7] = 0, n[8] = 1), n;
1091
1091
  }
1092
1092
  };
1093
1093
  //#endregion
1094
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateMetadata.js
1094
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateMetadata.js
1095
1095
  function k(e, t) {
1096
1096
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
1097
1097
  }
1098
1098
  //#endregion
1099
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
1099
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
1100
1100
  function A(e, t, n, r) {
1101
1101
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
1102
1102
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
@@ -2015,11 +2015,11 @@ void main(void) {
2015
2015
  }, r = {
2016
2016
  instanceId: lt(),
2017
2017
  usage: j.vertex,
2018
- data: new Float32Array()
2018
+ data: /* @__PURE__ */ new Float32Array()
2019
2019
  }, i = {
2020
2020
  instanceId: lt(),
2021
2021
  usage: j.index,
2022
- data: new Uint32Array()
2022
+ data: /* @__PURE__ */ new Uint32Array()
2023
2023
  }, a = {
2024
2024
  instanceId: lt(),
2025
2025
  topology: "triangle-list",
@@ -2058,7 +2058,7 @@ void main(void) {
2058
2058
  if (ee || p >= r) {
2059
2059
  t.textures = i, t.textureLocationMap = f, p = 0, t.start = l;
2060
2060
  for (let e = m; e <= h; e++) {
2061
- let { indices: r, vertices: p, uvs: h = new Float32Array(), size: g = {
2061
+ let { indices: r, vertices: p, uvs: h = /* @__PURE__ */ new Float32Array(), size: g = {
2062
2062
  width: 0,
2063
2063
  height: 0
2064
2064
  }, texture: ee, blendMode: te = an.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
@@ -3182,7 +3182,7 @@ var Bn = class extends M {
3182
3182
  super(), this.setProperties(e);
3183
3183
  }
3184
3184
  };
3185
- A([_({ fallback: j.index }), k("design:type", j === void 0 ? Object : j)], Wn.prototype, "usage", void 0), A([_({ default: () => new Uint32Array() }), k("design:type", Object)], Wn.prototype, "data", void 0);
3185
+ A([_({ fallback: j.index }), k("design:type", j === void 0 ? Object : j)], Wn.prototype, "usage", void 0), A([_({ default: () => /* @__PURE__ */ new Uint32Array() }), k("design:type", Object)], Wn.prototype, "data", void 0);
3186
3186
  //#endregion
3187
3187
  //#region src/scene/resources/geometries/Geometry.ts
3188
3188
  var Gn = class extends vt {
@@ -3201,7 +3201,7 @@ var F = class extends vt {
3201
3201
  super(), this.setProperties(e);
3202
3202
  }
3203
3203
  };
3204
- A([_({ fallback: j.vertex }), k("design:type", j === void 0 ? Object : j)], F.prototype, "usage", void 0), A([_({ default: () => new Float32Array() }), k("design:type", Object)], F.prototype, "data", void 0);
3204
+ A([_({ fallback: j.vertex }), k("design:type", j === void 0 ? Object : j)], F.prototype, "usage", void 0), A([_({ default: () => /* @__PURE__ */ new Float32Array() }), k("design:type", Object)], F.prototype, "data", void 0);
3205
3205
  //#endregion
3206
3206
  //#region src/scene/resources/geometries/VertexAttribute.ts
3207
3207
  var I = class extends vt {
@@ -3443,7 +3443,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3443
3443
  positionBuffer;
3444
3444
  uvBuffer;
3445
3445
  constructor(e) {
3446
- let t = new F({ data: new Float32Array() }), n = new F({ data: new Float32Array() });
3446
+ let t = new F({ data: /* @__PURE__ */ new Float32Array() }), n = new F({ data: /* @__PURE__ */ new Float32Array() });
3447
3447
  super({
3448
3448
  ...e,
3449
3449
  attributes: {
@@ -3456,7 +3456,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3456
3456
  buffer: n
3457
3457
  })
3458
3458
  },
3459
- indexBuffer: new Wn({ data: new Uint32Array() })
3459
+ indexBuffer: new Wn({ data: /* @__PURE__ */ new Uint32Array() })
3460
3460
  }), this.positionBuffer = t, this.uvBuffer = n;
3461
3461
  }
3462
3462
  }, z = class extends vt {
@@ -5072,8 +5072,8 @@ var yr = class {
5072
5072
  return this;
5073
5073
  }
5074
5074
  addTime(e) {
5075
- let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = this.currentTime;
5076
- return r += e, this.loop && r > t && (r = n + r % t), r = D(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
5075
+ let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = t - n, i = this.currentTime + e;
5076
+ return this.loop && r > 0 && i > t && (i = n + (i - n) % r), i = D(i, n, t), this.currentTime = i, this.emit("updateCurrentTime", i, e), this;
5077
5077
  }
5078
5078
  play(e) {
5079
5079
  return e?.rate !== void 0 && (this._rate = e.rate), e?.loopMode !== void 0 && (this.loopMode = e.loopMode), this._direction = 1, (!Number.isFinite(this.currentTime) || this.currentTime >= this.endTime) && (this.currentTime = Math.min(this.startTime, this.endTime)), this.playing = !0, this.playbackRate = this._rate * this._direction, this;
@@ -5803,7 +5803,7 @@ var Ur, Wr = class extends W {
5803
5803
  super(), this.setProperties(e).append(t);
5804
5804
  }
5805
5805
  apply(e, t) {
5806
- let n = new Float32Array(150), r = this.colors.map((e) => (this._color.value = e, this._color.toArray().slice(0, 3)));
5806
+ let n = /* @__PURE__ */ new Float32Array(150), r = this.colors.map((e) => (this._color.value = e, this._color.toArray().slice(0, 3)));
5807
5807
  for (; r.length < 50;) r.push([
5808
5808
  -1,
5809
5809
  0,
@@ -8094,9 +8094,9 @@ A([_({ fallback: "" }), k("design:type", String)], aa.prototype, "src", void 0),
8094
8094
  //#region src/scene/2d/Mesh2D.ts
8095
8095
  var oa = class extends ra {
8096
8096
  texture;
8097
- _vertices = new Float32Array();
8098
- _uvs = new Float32Array();
8099
- _indices = new Uint32Array();
8097
+ _vertices = /* @__PURE__ */ new Float32Array();
8098
+ _uvs = /* @__PURE__ */ new Float32Array();
8099
+ _indices = /* @__PURE__ */ new Uint32Array();
8100
8100
  get vertices() {
8101
8101
  return this._vertices;
8102
8102
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.24.4",
4
+ "version": "0.24.6",
5
5
  "packageManager": "pnpm@10.19.0",
6
6
  "description": "A JavaScript WebGL rendering engine. only the ESM.",
7
7
  "author": "wxm",
@@ -65,7 +65,7 @@
65
65
  "modern-font": "^0.6.1",
66
66
  "modern-idoc": "^0.12.1",
67
67
  "modern-path2d": "^1.8.5",
68
- "modern-text": "^2.0.6"
68
+ "modern-text": "^2.0.9"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "echarts": "^5 || ^6",
@@ -88,19 +88,19 @@
88
88
  }
89
89
  },
90
90
  "devDependencies": {
91
- "@antfu/eslint-config": "^9.0.0",
91
+ "@antfu/eslint-config": "^9.1.0",
92
92
  "@types/earcut": "^3.0.0",
93
- "@types/node": "^25.9.2",
93
+ "@types/node": "^26.0.0",
94
94
  "bumpp": "^11.1.0",
95
95
  "conventional-changelog-cli": "^5.0.0",
96
96
  "echarts": "^6.1.0",
97
- "eslint": "^10.4.1",
97
+ "eslint": "^10.5.0",
98
98
  "lottie-web": "^5.13.0",
99
99
  "modern-gif": "^2.1.0",
100
100
  "typescript": "^6.0.3",
101
101
  "unbuild": "^3.6.1",
102
- "vite": "^8.0.16",
103
- "vitest": "^4.1.8",
102
+ "vite": "^8.1.0",
103
+ "vitest": "^4.1.9",
104
104
  "yoga-layout": "^3.2.1"
105
105
  }
106
106
  }