Skip to content

Commit

Permalink
fix: 🐛 canvas is not cleaning up when switching slides
Browse files Browse the repository at this point in the history
When using DeckBuilder and adding slides via withSlide() methods there,
it creates each slide with its own canvas representation. It leads to
the problem, when deck is not able to clean up canvas when switching
slides back and forth. This commit fixes an issue by passing the right
canvas from Deck instance through SlideBuilder.withCanvas() method.
  • Loading branch information
ghaiklor committed May 10, 2020
1 parent ece0538 commit e6c6dd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/kittik-deck/src/DeckBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class DeckBuilder<TShape extends string, TAnimation extends string> {
}

public withSlide (fn: (builder: SlideBuilder<TShape, TAnimation>) => Slide): this {
const builder = SlideBuilder.start(this.shapes, this.animations);
const builder = SlideBuilder.start(this.shapes, this.animations).withCanvas(this.deck.canvas);
const slide = fn(builder);

this.deck.addSlide(slide);
Expand Down

0 comments on commit e6c6dd9

Please sign in to comment.