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
FitArea, FitWidth, FitHeight don't work for SVG images #852
Comments
I found that too, some SVGs seems to be misinterpreted and the "width" or "height" are not applied, also the fitarea, fitwidth and fitheight functions are not working. I still do not figure it out what is wrong in those svg files, attached a sample as a workaround I "cleaned" the SVG files using this online tool SVGOMG |
Turning the option "Prefer viewBox to width/height" on solved the problem. |
Thank you for the feedback and reporting this problem 😄 I have investigated the issue and applied several enhancements to how SVG images are scaled, especially when relative (%) or physical (mm, in, cm) units are used. Would you please test the newest |
Hi Marc, thanks for the update The svg fitting in the release if you only set "width" the image fits, there is no need to use "fit<area, width, height>" methods. the testing image is the one in my previous comment |
Hi Marcin, Same as here :( Thank you. |
This outcome is expected in specific scenarios. By default, every image uses the In the meantime, I will investigate the possibility of automatically detecting certain layout constraints and applying appropriate scaling behavior. For example, if the image is a child of the It has a chance to significantly improve the developer experience and library predictiveness. |
The |
Hello,
I use the following code to load SVG image and set it to fit the container size.
I couldn't make the logo to fit container height. Do i miss a detail?
Thanks in advance...
The text was updated successfully, but these errors were encountered: