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

ART add fillRule prop on iOS #5477

Closed
wants to merge 2 commits into from
Closed

ART add fillRule prop on iOS #5477

wants to merge 2 commits into from

Conversation

magicismight
Copy link
Contributor

ART add fileRule prop on iOS

fillRule="nonzero" // default value

<Surface
            height="210"
            width="210"
        >
<Shape 
    d="M100,10L40,198L190,78L10,78L160,198z"
    fill="lime"
    stroke="purple"
    strokeWidth="5"
/>
</Surface>

qq 20160122134854

fillRule="evenodd"

<Surface
            height="210"
            width="210"
        >
<Shape 
    d="M100,10L40,198L190,78L10,78L160,198z"
    fill="lime"
    stroke="purple"
    strokeWidth="5"
    fillRule="evenodd"
/>
</Surface>

qq 20160122134857

ART add fileRule prop on iOS
@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @spicyj, @kmagiera and @brentvatne to be potential reviewers.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jan 22, 2016
@magicismight magicismight changed the title ART add fileRule prop on iOS ART add fillRule prop on iOS Jan 22, 2016
move RCT_ENUM_CONVERTER to RCTConvert + ART
@facebook-github-bot
Copy link
Contributor

@magicismight updated the pull request.

@sophiebits
Copy link
Contributor

We'd like to keep this in sync with what https://github.com/reactjs/react-art supports, which currently only supports things that can be rendered to SVG, VML, or Canvas – not sure if fullRule falls into that bucket.

cc @sebmarkbage

@magicismight
Copy link
Contributor Author

SVG supports fill-rule.
Also see example 4 there

And it seems like VML also supports evenodd fill-rule.Link there

And canvas fill-rule there

If fillRule:evenodd not supported.this can`t be draw easily by using ART
start

@facebook-github-bot
Copy link
Contributor

@magicismight updated the pull request.

@sebmarkbage
Copy link
Contributor

VML doesn't have a fillRule. It has the opposite rule of the canvas one. That doesn't matter much since IE is dying quickly. It would only be useful for MS Office exports.

However, last I checked, the canvas fillRule support wasn't available cross-browser in currently active browser versions. It leads to strange artifacts when you have a browser that doesn't support it.

If you develop with the assumption that it exists, you may build something fairly complex around it that later can't be ported. ART provides a certain level of portability guarantees that is nice to have. Even if you don't think you'll need to target a browser right now.

On the flip side, you can always draw any shape with either fillrule. E.g. that star shape can be drawn using five triangles. Any decent vector graphics application will let you export it as such.

Do you have concrete use case where you're generating these on the fly where that is impractical?

@facebook-github-bot
Copy link
Contributor

@magicismight updated the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants