Closed waliarubal closed 4 years ago
Set the attribute preserveAspectRatio="none"
on the image. This issue is actually not related to the size function. Its just the way svg calculates size for you when you dont set preserveAspectRatio="none"
Thanks, that worked like a charm.
I have added a few image objects, when I am trying to resize the image using the size(width, height) method, images are maintaining aspect ratio which I don't want. Here is an example.
Lets say their is an image of size 320 x 240, now when I am calling size method with values other than a proper proportion, resizing is not working. For instance if I pass 100 x 200 in size method, image doesn't resize or it maintains an aspect ratio.
I would like image to take whatever size I need to resize the image to whatever value is provided without it maintaining the aspect ratio. Please let me know how to achieve this?