From 2cfeb0711b624b571a0f5f2e46bcdb758c17659b Mon Sep 17 00:00:00 2001 From: Nubo318 <69615769+Nubo318@users.noreply.github.com> Date: Thu, 20 Jan 2022 22:45:55 -0600 Subject: [PATCH] fixes wheel scaling Fixes the thing where for seemingly only some people, the brush scales too much with the mouse wheel. --- mods/wheel_fix.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mods/wheel_fix.js diff --git a/mods/wheel_fix.js b/mods/wheel_fix.js new file mode 100644 index 00000000..4088e8f5 --- /dev/null +++ b/mods/wheel_fix.js @@ -0,0 +1,14 @@ +// Version 1.0 of Wheel Fix by Nubo. This is a mod meant to fix the brush scaling too much with the mouse wheel for some people. +runAfterLoad(function() { + wheelHandle = function(e) { + e.preventDefault(); + var deltaY = e.deltaY*0.01; + if (Math.round(deltaY) == 0) { + if (deltaY > 0) { deltaY = 1; } + else { deltaY = -1; } + } + mouseSize += Math.round(deltaY*1.5); + if (mouseSize < 1) { mouseSize = 1; } + if (mouseSize > (height > width ? height : width)) { mouseSize = (height > width ? height : width); } + } +}); \ No newline at end of file