Skip to content

Commit

Permalink
bug: removing image does not remove it from final video #35 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwittstruck authored Apr 27, 2024
1 parent 362ad2b commit 9958016
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/services/animator/animator.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
})
});
6 changes: 6 additions & 0 deletions src/app/services/animator/animator.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 9958016

Please sign in to comment.