Skip to content

Commit 8027400

Browse files
committed
Clear the canvas in CanvasView before drawing
If the CanvasView doesn't clear the canvas before copying from the master canvas, transpartent parts originating from clear_rect will not appear in the CanvasViews.
1 parent 8df6a97 commit 8027400

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/widget.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ class CanvasView extends DOMWidgetView {
328328
}
329329

330330
updateCanvas() {
331+
this.clear();
331332
this.ctx.drawImage(this.model.canvas, 0, 0);
332333
}
333334

0 commit comments

Comments
 (0)