-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Svg is cropped when it is loaded via data url with FromImage or setSrc #6709
Comments
Your svg is missing width and height and for that reason won't reander in fabric most of the time. |
@asturur thanks for the hint. I would appreciate if you could answer my question. If possible, I would like to rely on the canvas.drawImage(...) function when using SVGs together with fabricjs, because I am afraid, that I will run into more issues using the fabricjs way of drawing SVGs. Does fabricjs somehow support that? |
The object that uses drawImage at its core is fabric.Image, but your svg has to have a width and height attribute |
@asturur Is there a workaround to pass the desired size into fabric.js? Background: I'm dealing with external images (so I can't modify them), but I know in which size I want to render them. |
v4.2.0
here is a fiddle that demonstrates the problem.
https://jsfiddle.net/tftomsun/gaojy6t4/85/
The canvas.drawImage(...) function works well (see fiddle). Is there a way in fabric to create an image object that is based on this function?
The text was updated successfully, but these errors were encountered: