shop-components 0.1.31 → 0.1.32

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.
@@ -36,6 +36,7 @@ export declare class Logo {
36
36
  name: string;
37
37
  imageUrl?: string;
38
38
  target: Mesh;
39
+ private _offscreen;
39
40
  get imageSize(): {
40
41
  width: number;
41
42
  height: number;
@@ -49,6 +50,7 @@ export declare class Logo {
49
50
  clear(): void;
50
51
  change(url?: string, scale?: Vector2, offset?: Vector2): void;
51
52
  reset(): void;
53
+ dispose(): void;
52
54
  }
53
55
  export declare class Skin {
54
56
  private _props;
@@ -64972,7 +64972,7 @@ zF.loadAsync(e5).then((n) => {
64972
64972
  const sH = new kO(A5);
64973
64973
  class $I {
64974
64974
  constructor(A) {
64975
- this._props = A, this.name = "", this._defaults = { ...A }, this.target = A.target, this.reset();
64975
+ this._props = A, this.name = "", this._offscreen = new OffscreenCanvas(0, 0), this._defaults = { ...A }, this.target = A.target, this.reset();
64976
64976
  }
64977
64977
  get imageSize() {
64978
64978
  return this._props.imageSize;
@@ -64984,24 +64984,30 @@ class $I {
64984
64984
  this.change();
64985
64985
  }
64986
64986
  change(A, e = new uA(1, 1), t = new uA()) {
64987
- var s;
64988
64987
  this.imageUrl = A;
64989
64988
  let i;
64990
64989
  if (A) {
64991
- const o = new Image();
64992
- o.crossOrigin = "anonymous", i = new ct(o), i.colorSpace = ke, i.wrapS = i.wrapT = it, i.repeat.set(1 / e.x, 1 / e.y), i.offset.set(t.x, t.y), o.onload = () => {
64993
- i && (i.flipY = !1, i.needsUpdate = !0);
64994
- }, o.src = A;
64990
+ const r = new Image();
64991
+ r.crossOrigin = "anonymous", r.src = A, r.onload = async () => {
64992
+ var l;
64993
+ let s = window.devicePixelRatio * 2;
64994
+ this._offscreen.width = r.width + s, this._offscreen.height = r.height + s;
64995
+ const o = this._offscreen.getContext("2d");
64996
+ o == null || o.clearRect(0, 0, this._offscreen.width, this._offscreen.height), o == null || o.drawImage(r, s / 2, s / 2, r.width, r.height), i = new ct(this._offscreen), i.minFilter = 1003, i.colorSpace = ke, i.wrapS = i.wrapT = it, i.repeat.set(1 / e.x, 1 / e.y), i.offset.set(t.x, t.y), i.flipY = !1, i.needsUpdate = !0;
64997
+ const a = this._props.target;
64998
+ a.material && (Array.isArray(a.material) ? a.material.forEach((u) => {
64999
+ var c;
65000
+ (c = u.map) == null || c.dispose(), i ? (u.map = i, u.opacity = 1) : u.opacity = 0;
65001
+ }) : ((l = a.material.map) == null || l.dispose(), i ? (a.material.map = i, a.material.opacity = 1) : (a.material.map = WS, a.material.opacity = 0)));
65002
+ };
64995
65003
  }
64996
- const r = this._props.target;
64997
- r.material && (Array.isArray(r.material) ? r.material.forEach((o) => {
64998
- var a;
64999
- (a = o.map) == null || a.dispose(), i ? (o.map = i, o.opacity = 1) : o.opacity = 0;
65000
- }) : ((s = r.material.map) == null || s.dispose(), i ? (r.material.map = i, r.material.opacity = 1) : (r.material.map = WS, r.material.opacity = 0)));
65001
65004
  }
65002
65005
  reset() {
65003
65006
  this._props = this._defaults, this.name = this._props.name, this.imageUrl = this._props.imageUrl, this.target = this._props.target, this.change(this.imageUrl || "");
65004
65007
  }
65008
+ dispose() {
65009
+ this._offscreen = null;
65010
+ }
65005
65011
  }
65006
65012
  class A2 {
65007
65013
  constructor(A) {