From 9958016379a5eb6107653ee01814d138eee96e2c Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sat, 27 Apr 2024 15:30:20 +0200 Subject: [PATCH] bug: removing image does not remove it from final video #35 (#36) --- src/app/services/animator/animator.service.spec.ts | 6 ++++++ src/app/services/animator/animator.service.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/app/services/animator/animator.service.spec.ts b/src/app/services/animator/animator.service.spec.ts index e0997d1..7a752bd 100644 --- a/src/app/services/animator/animator.service.spec.ts +++ b/src/app/services/animator/animator.service.spec.ts @@ -15,4 +15,10 @@ describe('AnimatorService', () => { it('should be created', () => { expect(service).toBeTruthy(); }); + + it('should remove frame from frameWebps', () => { + service.animator.frameWebps = ['a', 'b', 'c'] + service.removeFrames(1) + expect(service.animator.frameWebps).toEqual(['a', 'c']) + }) }); diff --git a/src/app/services/animator/animator.service.ts b/src/app/services/animator/animator.service.ts index 990b5f6..89f844a 100644 --- a/src/app/services/animator/animator.service.ts +++ b/src/app/services/animator/animator.service.ts @@ -50,9 +50,15 @@ export class AnimatorService { } removeFrames(index: number) { + // remove from visible frames: const frames = this.frames.getValue(); frames.splice(index, 1); this.frames.next(frames); + + // also remove from framesWebp: + const frameWebps = this.animator.frameWebps; + frameWebps.splice(index, 1) + this.animator.frameWebps = frameWebps; } getCameraIsRotated() {