You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that some SVGs are rendered too small when using the RetainShape scaling option. I tried to find out what distinguishes the SVGs that are scaled correctly from those that are scaled too small.
My conclusion is that if the optional attributes width and height in the root tag svg are missing, then the problem can occur.
It seems that without these attributes, the scaling algorithm assumes that the image is a square, where each side has a length of MAX(viewBox.width, viewBox.height).
I think RetainShape should work the same regardless of whether width and height are in the root tag or not.
We are not introspecting SVG files to see if they have or don't have the width and height attributes.
When we scale something and try to retain its shape, we simply ask that particular graphic what is its size.
We load SVG using Apache Batik and whatever Batik tells us about the size, we take it and don't question it.
If Batik does not handle the size well, maybe a bug should be logged against their project.
I have noticed that some SVGs are rendered too small when using the RetainShape scaling option. I tried to find out what distinguishes the SVGs that are scaled correctly from those that are scaled too small.
My conclusion is that if the optional attributes width and height in the root tag svg are missing, then the problem can occur.
It seems that without these attributes, the scaling algorithm assumes that the image is a square, where each side has a length of
MAX(viewBox.width, viewBox.height)
.I think RetainShape should work the same regardless of whether width and height are in the root tag or not.
Examples:
Template of the example:
The text was updated successfully, but these errors were encountered: