Clear canvas on redraw
authorJacob Casper <dev@jacobcasper.com>
Sun, 19 Apr 2020 04:33:39 +0000 (23:33 -0500)
committerJacob Casper <dev@jacobcasper.com>
Sun, 19 Apr 2020 04:33:39 +0000 (23:33 -0500)
frontend/index.js

index d49372f..26df246 100644 (file)
@@ -125,6 +125,7 @@ const drawMatchup = (canvas, x, y, iter, maxIter, left, artists, baseCallback) =
 }
 
 const drawBracket = (canvas, artists) => {
+    const context = canvas.getContext("2d").clearRect(0, 0, canvas.width, canvas.height);
     drawWinner(canvas);
     const [mid_x, mid_y] = getCenter(canvas);
     const [rect_width, rect_height] = getRectangleDimensions(canvas);