Skip to content

Commit

Permalink
adjust zoom sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbof committed Aug 26, 2024
1 parent 88aec73 commit 8d07f84
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/script/app/kl-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,12 +1112,18 @@ export class KlApp {
},
onZoomIn: () => {
const oldScale = this.easel.getTransform().scale;
const newScale = zoomByStep(oldScale, keyListener.isPressed('shift') ? 1 / 4 : 1);
const newScale = zoomByStep(
oldScale,
keyListener.isPressed('shift') ? 1 / 8 : 1 / 2,
);
this.easel.scale(newScale / oldScale);
},
onZoomOut: () => {
const oldScale = this.easel.getTransform().scale;
const newScale = zoomByStep(oldScale, keyListener.isPressed('shift') ? -1 / 4 : -1);
const newScale = zoomByStep(
oldScale,
keyListener.isPressed('shift') ? -1 / 8 : -1 / 2,
);
this.easel.scale(newScale / oldScale);
},
onUndo: () => {
Expand Down

0 comments on commit 8d07f84

Please sign in to comment.