From d7b6d3aebb6d7b163a83dbe7595ffc12f4a3098b Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Mon, 6 Apr 2026 01:32:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/app.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index 5bfbc99..1623908 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -803,14 +803,16 @@ const pts = [start, end].slice().sort((a, b) => a[0] - b[0] || a[1] - b[1]); const isForward = (start === pts[0]); - // Calculate curveness spread + // Calculate curveness: ensure all lines are slightly curved let finalCurve = 0; - if (count > 1) { - // Spread curveness between -0.3 and 0.3 - const maxSpread = 0.3; - const spread = (i - (count - 1) / 2) * (maxSpread * 2 / Math.max(1, count - 1)); - // Adjust sign based on direction so same "slot" arches same way in absolute terms - // A->B with curve C and B->A with curve -C arch to the same side of the AB chord + if (count === 1) { + finalCurve = 0.15; // Default slight curve for single lines + } else { + // Spread overlapping lines: 0.15, -0.15, 0.3, -0.3... + // This creates an "eye" or "fan" effect where no line is straight + const magnitude = 0.15 + Math.floor(i / 2) * 0.15; + const spread = (i % 2 === 0) ? magnitude : -magnitude; + // Adjust sign based on direction so they occupy unique visual slots finalCurve = isForward ? spread : -spread; }