Refactor long line

This commit is contained in:
2025-12-20 14:29:13 -08:00
parent 95c45ac7c6
commit f6974d43f4

View File

@@ -465,9 +465,13 @@
const x2 = l.getAttribute('x2'); const x2 = l.getAttribute('x2');
const y2 = l.getAttribute('y2'); const y2 = l.getAttribute('y2');
const str = `${x1},${y1} ${x2},${y2}`; const str = `${x1},${y1} ${x2},${y2}`;
if (mappedEdges.includes(str) && (lineContainer.childElementCount < 4 || !collisionEdges.includes(str))) {
l.remove(); if (mappedEdges.includes(str))
} if ([
lineContainer.childElementCount <= collisionEdges.length,
!collisionEdges.includes(str)
].some(c => c))
l.remove();
}); });
if (restart) { if (restart) {

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB