Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion code.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<body>
<canvas id="canvas"></canvas>
<script src="code.js"></script>
<link rel="stylesheet" href="style.css"></link>
<link rel="stylesheet" href="style.css"/>
</body>
</html>