-
Notifications
You must be signed in to change notification settings - Fork 38
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
fix: fix the problem that Black background when converting SVG to PNG #41
base: master
Are you sure you want to change the base?
Conversation
stari, can you please check if pull request #40, Support top level style solves this problem? I just merged it today into the main branch. |
@srwiley asked for my input in #40, so I'm giving it: I don't know a lot about svg gradients, so I can't say for sure that this solution is good. However, the implementation seems plausible to me. Parsing the contents of style tags within a gradient to obtain gradient related information sounds good. I am a bit confused about the chinese comments in the tests though. Since the rest of the project is in english, these should probably be translated. Apart from that, the PR looks good to me. |
Sorry, I submitted some Chinese comments into the code, accidentally. I've just removed the comment. Thanks! |
Sorry for taking so long to get back. I've been busy elsewhere. I can't accept this pull request as is. The main problem is that in order fix the GradStop bug you have rearranged 8 files. This makes it hard for me to see exactly what you changed because such larger blocks have been moved around. In addition, generated pngs should not be included with source code. Also, I can't see where the fix alters the output from the last merge in the example svgs. You also add the style function to the draw function maps twice, which is unnecessary. I am sure there is something good here, but please do the minimal alterations to the the existing structure, such as do not split out functions into individual files. |
When I parse a
style
attribute with a globalstyle
tag and astop
tag in a Graid component, I will encounter the problem of the above attribute parsing failure,and resulted in the problem that Black background when converting SVG to PNG. I would classify it as the parsing problem of the style attribute, so I submitted this PR to solve the above problem.