-
|
As the title says, I have an SVG image that I'm trying to display in the lightbox. The image is sized pretty small and the zoom doesn't seem to be working. Any idea how I can get this to display like a regular image? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
|
I'm pretty sure the image is sized according to the You could probably increase What are your expectations of the zoom feature in this case? How would you determine reasonable "max zoom" level for |
Beta Was this translation helpful? Give feedback.
-
|
Good questions. I'd like the initial zoom level to fill the viewport (maybe with a reasonable amount of padding) and have the max zoom be maybe 2x the viewport size. Increasing maxZoomPixelRatio might work for me... in this case the only slides are similar SVG images. I would look into adjusting the width and height specified in the file itself, but I get the file in the form of a blob from an API response and this happens at scale. |
Beta Was this translation helpful? Give feedback.
-
|
I seem to have found an acceptable solution by resizing the SVG programmatically as a percentage of the viewport width before passing it to the Lightbox. |
Beta Was this translation helpful? Give feedback.
-
|
Just following up on this to say that the reason I didn't create the repro was that I couldn't figure out an easy way to add the SVG blob part of the problem into the codesandbox. Since it's really easy to resize the SVG based on the viewport before passing it to the lightbox, I personally would consider this solved (in agreement with that being marked as the answer). |
Beta Was this translation helpful? Give feedback.
I seem to have found an acceptable solution by resizing the SVG programmatically as a percentage of the viewport width before passing it to the Lightbox.