Skip to content

Commit

Permalink
Make each scroll step to zoom 10%
Browse files Browse the repository at this point in the history
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
  • Loading branch information
starypatyk committed Aug 19, 2023
1 parent c6f34c8 commit ee0c498
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Images.vue
Expand Up @@ -180,8 +180,8 @@ export default {
const isZoomIn = event.deltaY < 0
const newZoomRatio = isZoomIn
? Math.min(this.zoomRatio + 0.1, 5) // prevent too big zoom
: Math.max(this.zoomRatio - 0.1, 1) // prevent too small zoom
? Math.min(this.zoomRatio * 1.1, 5) // prevent too big zoom
: Math.max(this.zoomRatio / 1.1, 1) // prevent too small zoom
// do not continue, img is back to its original state
if (newZoomRatio === 1) {
Expand Down

0 comments on commit ee0c498

Please sign in to comment.