Forum Discussion
DavidTait
7 years agoSuper Hero
SVG shrinking NOT zooming in Rise
I've just added an SVG in to Rise, the quality is fantastic vs PNG.
However there is a problem. I want the user to be able to click to zoom the image but the image actually shrinks when it's clic...
DavidKettle
6 years agoCommunity Member
I've managed to fix this for my workflow. I was saving svg file out of Adobe Illustrator and having the same problem with the SVG showing fine in an image with text, but shrinking to nothing when clicked on instead of zooming in.
Turning off the responsive option when saving the file worked to fix this, so the SVG would zoom to it's original/edited size.
The only real change I can see in the svg code in the file is it added id and width and height attributes in pixels to the svg tag.
Code which didn't work:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1000 500" style="enable-background:new 0 0 1000 500;" xml:space="preserve">
Code which does work:
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="1000px" height="500px" viewBox="0 0 1000 500" style="enable-background:new 0 0 1000 500;" xml:space="preserve">
I've attached a couple of SVGs which demonstrate this.
- DavidTait6 years agoSuper Hero
Hi David, your fix works for me too, thanks so much for posting it!
- DavidKettle6 years agoCommunity Member
Hi David, that's good to hear, I'm glad it was helpful :)
Related Content
- 5 months ago
- 5 months ago
- 10 months ago
- 3 months ago