Skip to content

Instantly share code, notes, and snippets.

View mutoe's full-sized avatar
😃
Charging

Dongsen mutoe

😃
Charging
View GitHub Profile
window.onwheel = function (e) {
e.preventDefault();
if (e.ctrlKey) {
// Your zoom/scale factor
scale -= e.deltaY * 0.01;
} else {
// Your trackpad X and Y positions
posX -= e.deltaX * 2;
posY -= e.deltaY * 2;