Skip to content

Commit

Permalink
fix: remove symbol (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
fanmingfei authored Dec 9, 2021
1 parent b0a9bdd commit 3f1348f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { BaseTexture, utils } from "pixi.js";
import { CompressedTextureResource } from "../resource/CompressedTextureResource";
const oldFrom = Symbol();
export const BaseTextureMixin = {
[oldFrom]: BaseTexture.from,
oldFrom: BaseTexture.from,
from(source, scaleMode, sourceScale) {

if (!(source instanceof CompressedTextureResource)) {
return this[oldFrom](source, scaleMode, sourceScale);
return this.oldFrom(source, scaleMode, sourceScale);
}

const imageUrl = source.src;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { BaseTexture, Texture } from "pixi.js";
import { CompressedTextureResource } from "../resource/CompressedTextureResource";
const oldFrom = Symbol();
export const TextureMixin = {
[oldFrom]: Texture.from,
oldFrom: Texture.from,
from(source) {
if (!(source instanceof CompressedTextureResource)) {
return this[oldFrom](source);
return this.oldFrom(source);
}
return new Texture(BaseTexture.from(source as any));
}
}

0 comments on commit 3f1348f

Please sign in to comment.