From b6bc696823bd58f982805197f9d6bafb859a7f73 Mon Sep 17 00:00:00 2001 From: Catalin Constantin Mititiuc Date: Tue, 23 Dec 2025 16:41:50 -0800 Subject: [PATCH] Inverse? --- html/images/space.svg | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/html/images/space.svg b/html/images/space.svg index 633a0fb..2b11514 100644 --- a/html/images/space.svg +++ b/html/images/space.svg @@ -60,6 +60,12 @@ #legs { display: none; } + + .wall.inverse { + stroke: blue; + fill: white; + fill-opacity: 0.5; + } @@ -73,7 +79,10 @@ - + + + + @@ -133,7 +142,7 @@ const halfPi = Math.PI / 2; const maxSpeed = 100; - const drawCollisionLines = false; + const drawCollisionLines = true; let previous, zero, frameCount = 0; // let position = [0, 0]; // meters @@ -656,6 +665,7 @@ svg.addEventListener("pointermove", function({ clientX, clientY }) { pointerPt.x = clientX; pointerPt.y = clientY; + // https://www.sitepoint.com/how-to-translate-from-dom-to-svg-coordinates-and-back-again/ const svgP = pointerPt.matrixTransform(svg.getScreenCTM().inverse()); if (bg.isPointInFill(svgP)) {