Skip to content

Commit

Permalink
Fix texture source updating
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy committed Feb 16, 2024
1 parent cc79c84 commit 2f8704b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/AnimatedGIF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,8 @@ class AnimatedGIF extends Sprite
const canvas = DOMAdapter.get().createCanvas(width, height) as HTMLCanvasElement;
const context = canvas.getContext('2d') as CanvasRenderingContext2D;

this.texture = Texture.from(new TextureSource({
resource: canvas,
scaleMode,
}));
this.texture = Texture.from(canvas);
this.texture.source.scaleMode = scaleMode;

this.duration = (frames[frames.length - 1] as FrameObject).end;
this._frames = frames;
Expand Down Expand Up @@ -409,8 +407,7 @@ class AnimatedGIF extends Sprite
// See: https://bugs.webkit.org/show_bug.cgi?id=229986
this._context.fillStyle = 'transparent';
this._context.fillRect(0, 0, 0, 1);

this.texture.update();
this.texture.source.update();

// Mark as clean
this.dirty = false;
Expand Down

0 comments on commit 2f8704b

Please sign in to comment.