Skip to content

Commit

Permalink
trying out new factor for mouse / wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
ElyaConrad committed Apr 19, 2024
1 parent eafc22c commit e4866a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zoompinch-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zoompinch",
"private": false,
"version": "0.0.33",
"version": "0.0.34",
"type": "module",
"files": [
"package.json",
Expand Down
2 changes: 1 addition & 1 deletion zoompinch-vue/src/controllers/wheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function useWheel({
function handleWheel(event: WheelEvent) {
let { deltaX, deltaY, ctrlKey } = event;
const mouseMultiples = [120, 100];
const mouseFactor = 4;
const mouseFactor = ctrlKey ? 2 : 2;
if (!detectTrackpad(event)) {
if (Math.abs(deltaX) === 120 || Math.abs(deltaX) === 200) {
deltaX = (deltaX / ((100 / mouseFactor) * isMultipleOf(deltaX, mouseMultiples))) * Math.sign(deltaX);
Expand Down

0 comments on commit e4866a4

Please sign in to comment.