From fd078ca29f5390a3884d92522983da452f292fb3 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Wed, 17 Jun 2020 18:21:21 -0400 Subject: [PATCH] Zoom to the center when the y-axis is unlocked --- macrovision.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/macrovision.js b/macrovision.js index 64d96d48..7ff47a88 100644 --- a/macrovision.js +++ b/macrovision.js @@ -2126,8 +2126,13 @@ document.addEventListener("DOMContentLoaded", () => { toastRateLimit("Zoom is locked! Check Settings to disable.", "zoom-lock", 1000); } else { const dir = e.deltaY < 0 ? 10 / 11 : 11 / 10; + const change = config.height.toNumber("meters") - math.multiply(config.height, dir).toNumber("meters"); setWorldHeight(config.height, math.multiply(config.height, dir)); updateWorldOptions(); + + if (!config.lockYAxis) { + config.y += change / 2; + } } }