Skip to content

Commit

Permalink
corrected bugg..
Browse files Browse the repository at this point in the history
  • Loading branch information
MauriceConrad committed Apr 19, 2024
1 parent d623992 commit eafc22c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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.32",
"version": "0.0.33",
"type": "module",
"files": [
"package.json",
Expand Down
14 changes: 7 additions & 7 deletions zoompinch-vue/src/controllers/wheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ export function useWheel({
let { deltaX, deltaY, ctrlKey } = event;
const mouseMultiples = [120, 100];
const mouseFactor = 4;
if (Math.abs(deltaX)) {
}
if (isMultipleOf(deltaX, mouseMultiples)) {
deltaX = (deltaX / ((100 / mouseFactor) * isMultipleOf(deltaX, mouseMultiples))) * Math.sign(deltaX);
}
if (isMultipleOf(deltaY, mouseMultiples)) {
deltaY = (deltaY / ((100 / mouseFactor) * isMultipleOf(deltaY, mouseMultiples))) * Math.sign(deltaY);
if (!detectTrackpad(event)) {
if (Math.abs(deltaX) === 120 || Math.abs(deltaX) === 200) {
deltaX = (deltaX / ((100 / mouseFactor) * isMultipleOf(deltaX, mouseMultiples))) * Math.sign(deltaX);
}
if (Math.abs(deltaY) === 120 || Math.abs(deltaY) === 200) {
deltaY = (deltaY / ((100 / mouseFactor) * isMultipleOf(deltaY, mouseMultiples))) * Math.sign(deltaY);
}
}
const currScale = scale.value;
if (ctrlKey) {
Expand Down

0 comments on commit eafc22c

Please sign in to comment.