From 0c55380f3881677d359b3242eff92717da423d49 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Tue, 3 Mar 2020 16:42:55 -0500 Subject: [PATCH] Make scrolling preserve apparent x-position as well (alt to disable) --- macrovision.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/macrovision.js b/macrovision.js index 704b6972..26a029d0 100644 --- a/macrovision.js +++ b/macrovision.js @@ -90,7 +90,8 @@ function snapRel(coords) { } function adjustAbs(coords, oldHeight, newHeight) { - return { x: coords.x, y: 1 + (coords.y - 1) * math.divide(oldHeight, newHeight) }; + const ratio = math.divide(oldHeight, newHeight); + return { x: 0.5 + (coords.x - 0.5) * math.divide(oldHeight, newHeight), y: 1 + (coords.y - 1) * math.divide(oldHeight, newHeight) }; } function rel2abs(coords) {