Skip to content

Commit

Permalink
fix: ensure zooming out doesn't happen (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
paazca authored Nov 14, 2022
1 parent dd01423 commit b920940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/medium-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ const mediumZoom = (selector, options = {}) => {
: zoomTarget.naturalHeight || viewportHeight
const { top, left, width, height } = zoomTarget.getBoundingClientRect()

const scaleX = Math.min(naturalWidth, viewportWidth) / width
const scaleY = Math.min(naturalHeight, viewportHeight) / height
const scaleX = Math.min(Math.max(width, naturalWidth), viewportWidth) / width
const scaleY = Math.min(Math.max(height, naturalHeight), viewportHeight) / height
const scale = Math.min(scaleX, scaleY)
const translateX =
(-left +
Expand Down

0 comments on commit b920940

Please sign in to comment.