modern-canvas 0.24.4 → 0.24.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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -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;
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.5",
5
5
  "packageManager": "pnpm@10.19.0",
6
6
  "description": "A JavaScript WebGL rendering engine. only the ESM.",
7
7
  "author": "wxm",