-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
[Bug]: Cannot handle post-defined elements & reused <use> elements #170
Comments
This has been noticed before. If the It's on the agenda but is a bit of a rarer use case. It does happen and use objects referencing future objects just like css sheets affecting objects in the past, isn't quite there because of the ordering of the parsing. |
This was fixed in #160. Specifically it should handle your case. Even when that ordering worked it would get the element with the get by |
It appears that I missed a spot. The x, y values are supposed to override the other values. So if you set x, y values, it's supposed to compound them in a particular way that is currently wrong. I'll check into correcting that. |
When briefly scanning the code, I came up with two little suggestions.
|
I did expand the Use instances a bit to include the x, y, height, and width specifically because I needed those to not propagate per spec. This should be fixed in |
Correct issue #170 expand Use slightly
Okay, should be fixed in 1.8.1 |
Thanks a lot! Now the result is as expected. |
Summary Description
There are some problems when parsing elements which refer to other elements defined later, as well as elements with a transform parameter which are reused for multiple times. The latter of them may have been mentioned in #169.
Additional Details
When trying to deal with 3b1b/manim#1760, I notice that svgelements fails to handle the following svg file:
There're two issues popping out. Firstly, the id
g6-65
uses glyphg3-65
, which is defined after it, making svgelements cannot recognize the element and returnsSVGElement
instances instead ofPath
s. Secondly, if I switch these two lines, from the result of parsing it can be noticed that theg6-65
elements are really far apart, and are even not aligned horizontally given they
attributes are equal. The latter of them may have been mentioned in #169.The text was updated successfully, but these errors were encountered: