From 3e64f888c60975f40cb7b2e2cd60e29da2d3fb19 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 21 Oct 2023 13:16:34 +0200 Subject: Move "scroll with middle mouse" initialization to common code. --- public/common/client.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'public') diff --git a/public/common/client.js b/public/common/client.js index 8168250..6dd38f2 100644 --- a/public/common/client.js +++ b/public/common/client.js @@ -901,9 +901,12 @@ var update_layout = function () {} /* PAN & ZOOM GAME BOARD */ ;(function panzoom_init() { + var PAN_SPEED = Number(document.querySelector("main").dataset.panSpeed) || 1 var MIN_ZOOM = Number(document.querySelector("main").dataset.minZoom) || 0.5 var MAX_ZOOM = Number(document.querySelector("main").dataset.maxZoom) || 1.5 + scroll_with_middle_mouse("main", PAN_SPEED) + const THRESHOLD = 0.0625 const DECELERATION = 125 -- cgit v1.2.3