diff --git a/code.js b/code.js index cf2fcc3..73d3bb5 100644 --- a/code.js +++ b/code.js @@ -53,6 +53,7 @@ const circle = (ctx, type, color, radius, p) => { }); }; +// Not used currently const rect = (ctx, stroke, color, x, y, w, h) => { if (!stroke) { ctx.fillStyle = color; @@ -63,6 +64,10 @@ const rect = (ctx, stroke, color, x, y, w, h) => { } }; +const clearRect = (ctx, x, y, w, h) => { + ctx.clearRect(x, y, w, h); +}; + const text = (ctx, stroke, color, font, text, x, y) => { ctx.font = font; if (!stroke) { @@ -128,7 +133,7 @@ const main = () => { setTriangle(); } - rect(ctx, false, "white", 0, 0, canvas.width, canvas.height); + clearRect(ctx, 0, 0, canvas.width, canvas.height); // Create point pairs beforehand const pointPairs = permute(points); diff --git a/page.html b/page.html index 03a4bff..c4e84f7 100644 --- a/page.html +++ b/page.html @@ -2,6 +2,6 @@ - + \ No newline at end of file