Skip to content

Commit

Permalink
fix: add padding to zoomed image
Browse files Browse the repository at this point in the history
  • Loading branch information
HellWolf93 committed May 18, 2021
1 parent 096ea92 commit 66fd48f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/ZoomableImage/helpers/getTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ export default function getTransform(rect) {

const widthRatio = width / viewportWidth;
const heightRatio = height / viewportHeight;
const scale = heightRatio > widthRatio ? viewportHeight / height : viewportWidth / width;

return {
translateX,
translateY,
scale: heightRatio > widthRatio ? viewportHeight / height : viewportWidth / width,
scale: scale * 0.85,
};
}

0 comments on commit 66fd48f

Please sign in to comment.