From 4e3e2dd6e044637600808c32fd130eb867c57711 Mon Sep 17 00:00:00 2001 From: Azmoria <65363489+Azmoria@users.noreply.github.com> Date: Fri, 25 Oct 2024 01:41:37 -0400 Subject: [PATCH] Beta Fix - snap to grid should not be applying to projector mode when zoom lock is enabled. --- CoreFunctions.js | 2 +- Main.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CoreFunctions.js b/CoreFunctions.js index f3c373689..77fe299ba 100644 --- a/CoreFunctions.js +++ b/CoreFunctions.js @@ -970,7 +970,7 @@ function projector_scroll_event(event){ scrollPercentageX: (window.pageXOffset + window.innerWidth/2 - sidebarSize/2) / Math.max( document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth ), zoom: zoom, - mapPos: convert_point_from_view_to_map(center.x, center.y) + mapPos: convert_point_from_view_to_map(center.x, center.y, true) }); } } diff --git a/Main.js b/Main.js index 4c0047201..2e19499ff 100644 --- a/Main.js +++ b/Main.js @@ -2667,7 +2667,11 @@ function init_ui() { // Function separated so it can be dis/enabled function mousemove(m) { if (curDown) { - window.scrollBy(curXPos - m.pageX, curYPos - m.pageY) + let scrollOptions = { + left: window.scrollX + curXPos - m.pageX, + top: window.scrollY + curYPos - m.pageY + } + requestAnimationFrame(function(){window.scrollTo(scrollOptions)}); } }