From 33df91f7d328d2bd554f5fc85243a30e66c08565 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sun, 9 Feb 2020 20:01:03 +0100 Subject: [PATCH] Fix hovering when roaming --- voicegardens/static/voicegardens.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index fd0e05b..f19afd6 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -451,7 +451,11 @@ function draw() { let shape = shapes[i]; // if hovering over the shape, play the recorded sound - let hovering = collidePointPoly(mouseX, mouseY, shape.vectors); + let hovering = collidePointPoly( + mouseX - screenX, + mouseY - screenY, + shape.vectors + ); if (hovering === true) { if (shape.hover === false) { shape.sound();