swiper icon indicating copy to clipboard operation
swiper copied to clipboard

Constrain max zoom to 100% of a slide's image size on the Zoom module

Open broox opened this issue 1 year ago • 0 comments

Clear and concise description of the problem

A numeric maxRatio multiplier can be specified as an option on the Zoom module, which is great, however the image can scale past a reasonable resolution if the image is small. It would be nice to be able to specify a maxRatio of 100% of the original image.

Suggested solution

Allow a percentage to be passed into maxRatio, introduce a maxRatioPercentage property, or an optional boolean field to prevent zooming past 100% of the original image size.

Alternative

No response

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this feature?

  • [X] I'm willing to open a PR

broox avatar Feb 10 '24 15:02 broox