MCPcopy Create free account
hub / github.com/bwasti/mebm / wheel

Method wheel

script.js:1003–1023  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

1001 let gestureStartScale = 0;
1002
1003 let wheel = function(e) {
1004 if (e.ctrlKey || e.shiftKey) {
1005 e.preventDefault();
1006 let delta = e.deltaY;
1007 if (!Math.abs(delta) && e.deltaX != 0) {
1008 delta = e.deltaX * 0.5;
1009 }
1010 let scale = 1;
1011 scale -= delta * 0.01;
1012 // Your zoom/scale factor
1013 callback(scale, 0);
1014 } else if (e.altKey) {
1015 let delta = e.deltaY;
1016 if (!Math.abs(delta) && e.deltaX != 0) {
1017 delta = e.deltaX * 0.5;
1018 }
1019 let rot = -delta * 0.1;
1020 // Your zoom/scale factor
1021 callback(0, rot);
1022 }
1023 }
1024 // safari
1025 let gesturestart = function(e) {
1026 this.gesturing = true;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected