Skip to content

Commit

Permalink
fix: fix cache problem in Icon.loadGif() #2905
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Dec 3, 2024
1 parent c85b1a1 commit 61578b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions common/changes/@visactor/vtable/fix-load-gif_2024-12-03-09-19.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix cache problem in Icon.loadGif() #2905",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
2 changes: 1 addition & 1 deletion packages/vtable/src/scenegraph/graphic/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Icon extends Image {

loadGif() {
this.playing = false;
ResourceLoader.GetFile((this.attribute as any).gif, 'arrayBuffer')
ResourceLoader.GetFile((this.attribute as any).gif + '?role=gif', 'arrayBuffer') // ?role=gif: hack for ResourceLoader cache
.then((res: ArrayBuffer) => {
const gif = parseGIF(res);
const frames = decompressFrames(gif, true);
Expand Down

0 comments on commit 61578b7

Please sign in to comment.