From e6c6dd9f622bea9071f51776d657f7c87bdf680e Mon Sep 17 00:00:00 2001 From: Eugene Obrezkov Date: Sun, 10 May 2020 20:39:35 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20canvas=20is=20not=20clean?= =?UTF-8?q?ing=20up=20when=20switching=20slides?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/kittik-deck/src/DeckBuilder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kittik-deck/src/DeckBuilder.ts b/packages/kittik-deck/src/DeckBuilder.ts index 9de2b0b..0ce784f 100644 --- a/packages/kittik-deck/src/DeckBuilder.ts +++ b/packages/kittik-deck/src/DeckBuilder.ts @@ -28,7 +28,7 @@ export class DeckBuilder { } public withSlide (fn: (builder: SlideBuilder) => 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);