fixes wheel scaling

Fixes the thing where for seemingly only some people, the brush scales too much with the mouse wheel.
This commit is contained in:
Nubo318 2022-01-20 22:45:55 -06:00 committed by GitHub
parent f2d45f1b33
commit 2cfeb0711b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

14
mods/wheel_fix.js Normal file
View File

@ -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); }
}
});