-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images scaled with RetainShape are sometimes rendered too small #483
Comments
We are not introspecting SVG files to see if they have or don't have the width and height attributes. Thank you, |
I'm taking it back. We do seem to look for width and height attributes in the svg tag. Digging... Thanks, |
What can I do to move this issue forward? |
What is the size of an SVG that does not provide width and height? Thank you, |
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: