From 69932db0b5245c88af7bbab5ebd5eb6deb539fac Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Sat, 8 Aug 2026 15:38:11 +0200 Subject: [PATCH] fix(canvas): ensure beginPath is called on circle polygon paths to prevent stray connecting lines --- public/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app.js b/public/app.js index a966547..6897e7c 100644 --- a/public/app.js +++ b/public/app.js @@ -392,16 +392,17 @@ // --- Helper: Polygon Path Generator --- function drawPolygonPath(targetCtx, sides, radius, cornerRadius = 0) { + targetCtx.beginPath(); if (sides === 0) { // Circle targetCtx.arc(0, 0, radius, 0, Math.PI * 2); + targetCtx.closePath(); return; } const angleStep = (Math.PI * 2) / sides; const startAngle = -Math.PI / 2; // Point top - targetCtx.beginPath(); for (let i = 0; i < sides; i++) { const a = startAngle + i * angleStep; const x = Math.cos(a) * radius;