-
Notifications
You must be signed in to change notification settings - Fork 73
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
How to scale SVGs without preserving the aspect ratio #44
Comments
That definitely needs to be available, but is a use-case I hadn't worked out in my initial code to get the 9-slice rendering working. Thank you for creating an issue about it. Let me see what I can do to get that working properly. Just to confirm, you're asking if you can simply stretch an SVG to whatever container size it is in, right? If you have an SVG originally sized at 50x50 and you put it in a 150x200 container, without any 9-slice rendering, it just stretches the original SVG to 150x200. |
Awesome! Sounds great. Yep, that's exactly right, it would stretch the SVG to fill the container. I believe it has something to do with the section that says |
@patridge I took a swing at this, but I couldn't figure out exactly where this would even be set since i'm not all that familiar with the code. |
Sorry for my total lack of communication here. I started something up and kept hitting snags without sharing my progress. I know most of the code, so I'm not sure what my excuse is for my failing solution to the various aspect settings. I went with using the
I have everything appearing to work successfully in a demo for the NControl.SvgImageView version, though that might just be because I don't have enough test cases. Unfortunately, with the original SvgImage version, a number of aspect options aren't rendering correctly (despite being mostly the same code these days). Let me get together what I can for other eyes to look over, and maybe we can nail down a more bulletproof (or at least mildly bullet resistant) solution. |
Is there a way to get the SVGs to scale properly to the set Width and Height without preserving the aspect ratio? I tried setting
preserveAspectRatio="none"
and a few other settings and nothing worked. I'm testing it on Android btw.The text was updated successfully, but these errors were encountered: