Skip to content

Commit

Permalink
fix square hover
Browse files Browse the repository at this point in the history
  • Loading branch information
fulldecent committed Dec 5, 2023
1 parent f29960c commit 27c420d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
const positionDiv = document.getElementById("position");
const tooltipDiv = document.getElementById("tooltip");
const whereToGoAnchor = document.getElementById("wheretogo");
const x = Math.min(Math.max(Math.floor((e.clientX - theImage.x) / 10), 0), 99);
const y = Math.min(Math.max(Math.floor((e.clientY - theImage.y) / 10), 0), 99);
const x = Math.min(Math.max(Math.floor((e.clientX - theImage.x / 2) / 10), 0), 99);
const y = Math.min(Math.max(Math.floor((e.clientY - theImage.y / 2) / 10), 0), 99);
const squareNumber = x + y * 100 + 1;
positionDiv.style.left = x * 10 + "px";
positionDiv.style.top = y * 10 + "px";
Expand All @@ -151,7 +151,7 @@
// Animate the electric fence
let fence = new Set();
let litUpEdge = new Set();
let wasEverLitUp = new Set([1]);
let wasEverLitUp = new Set();

function lightUpFence(edge) {
// Unlight old
Expand Down

0 comments on commit 27c420d

Please sign in to comment.