Skip to content

Commit f47ed34

Browse files
fix: update removeAnimationByTargetKey to handle multiple animations
1 parent 687eb9e commit f47ed34

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/webgal/src/Core/controller/stage/pixi/PixiController.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,11 @@ export default class PixiStage {
304304
}
305305

306306
public removeAnimationByTargetKey(targetKey: string) {
307-
const index = this.stageAnimations.findIndex((e) => e.targetKey === targetKey);
308-
this.removeAnimationByIndex(index);
307+
let index = this.stageAnimations.findIndex((e) => e.targetKey === targetKey);
308+
while (index !== -1) {
309+
this.removeAnimationByIndex(index);
310+
index = this.stageAnimations.findIndex((e) => e.targetKey === targetKey);
311+
}
309312
}
310313

311314
public removeAnimationWithSetEffects(key: string) {

0 commit comments

Comments
 (0)