-
-
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 id attribut is missing #2285
Comments
that line should remove id attribute from cloned object that was referenced by use tag. it is correct like that. the id attribute is not parsed. please check the parsedAttribute array and add "id" there. check any object fromElement method to see the corret spelling of this array name. |
The parsed attributes used by fromElement are defined in fabric.SHARED_ATTRIBUTES (in header.js). This is my modified version : /* _FROM_SVG_START_ */
/**
* Attributes parsed from all SVG elements
* @type array
*/
fabric.SHARED_ATTRIBUTES = [
"id",
"display",
"transform",
"fill", "fill-opacity", "fill-rule",
"opacity",
"stroke", "stroke-dasharray", "stroke-linecap",
"stroke-linejoin", "stroke-miterlimit",
"stroke-opacity", "stroke-width"
];
/* _FROM_SVG_END_ */ Do you think I have to modify object.class.js to manage it as default property of an object ? |
i do not know why is not parsed by default. maybe a
in your application is enough. |
I wouldn'd mind adding support for parsing id! Marking as feature. |
Ok i do a quick PR. |
I want to manage my object imported from SVG by their ID.
But, the 'id' attribute is missing in FabricsJS.
The SVG 'id' attribute is removed in parseUseDirectives function by the line : el2.removeAttribute('id');
The text was updated successfully, but these errors were encountered: