Skip to content

Commit

Permalink
fix(image-viewer): 滚轮缩放符合操作直觉 (#3738)
Browse files Browse the repository at this point in the history
滚轮缩放符合操作直觉
  • Loading branch information
sinbadmaster authored Dec 13, 2023
1 parent 5593700 commit 6f911ff
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/image-viewer/image-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,9 @@ export default defineComponent({

const onWheel = (e: WheelEvent) => {
e.preventDefault();
const { deltaY, ctrlKey } = e;
// mac触摸板双指缩放时ctrlKey=true,deltaY>0为缩小 <0为放大
if (ctrlKey) {
return deltaY > 0 ? onZoomOut() : onZoomIn();
}
deltaY > 0 ? onZoomIn() : onZoomOut();
const { deltaY } = e;

deltaY > 0 ? onZoomOut() : onZoomIn();
};

const transStyle = computed(() => ({
Expand Down

0 comments on commit 6f911ff

Please sign in to comment.