From 31d97be00a006e6bf5a2e657d8b9713cb3ab6829 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 23 May 2020 14:54:57 -0400 Subject: [PATCH] Fix position snapping when the camera has moved --- macrovision.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macrovision.js b/macrovision.js index bdcd6e28..346fa60d 100644 --- a/macrovision.js +++ b/macrovision.js @@ -221,8 +221,8 @@ function constrainRel(coords) { return coords; } return { - x: Math.min(Math.max(coords.x, -worldWidth / 2), worldWidth / 2), - y: Math.min(Math.max(coords.y, 0), worldHeight) + x: Math.min(Math.max(coords.x, -worldWidth / 2 + config.x), worldWidth / 2 + config.x), + y: Math.min(Math.max(coords.y, config.y), worldHeight + config.y) } } function snapRel(coords) {