From 7e47fb2dd3fbee8d3b73ec93038a9bb8d87aec12 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 23 May 2020 16:19:38 -0400 Subject: [PATCH] Make shift-scrolling movement proportional to world height --- macrovision.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macrovision.js b/macrovision.js index cb846caf..c48b801b 100644 --- a/macrovision.js +++ b/macrovision.js @@ -1930,9 +1930,9 @@ document.addEventListener("DOMContentLoaded", () => { updateViewOptions(entity, entity.view); updateSizes(true); } else { - document.querySelectorAll(".entity-box").forEach(element => { - element.dataset.x = parseFloat(element.dataset.x) + (e.deltaY < 0 ? 0.1 : -0.1); - }); + const worldWidth = config.height.toNumber("meters") / canvasHeight * canvasWidth; + config.x += (e.deltaY > 0 ? 1 : -1) * worldWidth / 20 ; + updateSizes(); updateSizes(); }