From 21b80784e142be1fe929c9139f883ee8d49dd710 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 23 May 2020 15:20:21 -0400 Subject: [PATCH] Make the scroll-button speed proportional to world size --- macrovision.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/macrovision.js b/macrovision.js index 11496ab5..c65d4179 100644 --- a/macrovision.js +++ b/macrovision.js @@ -1670,12 +1670,14 @@ function setHelpDate() { } function doYScroll() { - config.y += scrollDirection / 180; + const worldHeight = config.height.toNumber("meters"); + config.y += scrollDirection * worldHeight / 180; updateSizes(); scrollDirection *= 1.05; } function doXScroll() { - config.x += scrollDirection / 180; + const worldWidth = config.height.toNumber("meters") / canvasHeight * canvasWidth; + config.x += scrollDirection * worldWidth / 180 ; updateSizes(); scrollDirection *= 1.05; }