Skip to content
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

Default SVG shape fill color is black #440

Closed
vahotm opened this issue Jun 26, 2018 · 3 comments
Closed

Default SVG shape fill color is black #440

vahotm opened this issue Jun 26, 2018 · 3 comments
Assignees
Milestone

Comments

@vahotm
Copy link

vahotm commented Jun 26, 2018

For example, I have rect:

<rect fill-opacity="0" height="10" stroke="#000000" stroke-width="3" width="10" x="0" y="0"/>

Although fill color is not specified, "fill-opacity" is set to 0 - rect should be transparent. But as long as "fill" is not specified, SVGParser sets fill color to opaque black.

Code from SVGParser:

guard var fillColor = styleParts["fill"] else {
    return Color.black
 }
@ystrot ystrot closed this as completed in f08fca9 Jun 27, 2018
ystrot added a commit that referenced this issue Jun 27, 2018
Fix #440: Default SVG shape fill color is black
@ystrot ystrot self-assigned this Jun 27, 2018
@ystrot ystrot added this to the 0.9.2 milestone Jun 27, 2018
@ystrot
Copy link
Member

ystrot commented Jun 27, 2018

This fix available in the master branch and will be part of the upcoming 0.9.2 release.

@timcloss
Copy link

timcloss commented Jul 19, 2018

Remember you also need to set the SVGView isOpaque property to false...

@f3dm76
Copy link
Collaborator

f3dm76 commented Jul 20, 2018

Sorry, we don't really understand what you mean by that. Here is how Macaw draws your example, and we believe it's correct. If you still have the problem, could you please elaborate?
screen shot 2018-07-20 at 11 51 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants