Bug 19932 - Proposal: Add CanvasRenderingContext2D.fillRule
Proposal: Add CanvasRenderingContext2D.fillRule
Status: RESOLVED FIXED
Product: WHATWG
Classification: Unclassified
Component: HTML
unspecified
All All
: P2 normal
: Unsorted
Assigned To: Ian 'Hixie' Hickson
contributor
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-10 16:15 UTC by Yury
Modified: 2013-01-03 23:38 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yury 2012-11-10 16:15:18 UTC
I could not find any response or actions to the:

* http://lists.w3.org/Archives/Public/public-whatwg-archive/2011Jun/0123.html
* http://lists.w3.org/Archives/Public/public-whatwg-archive/2007May/0338.html

While working on pdf.js and shumway projects I noticed that even-odd fill rule is used by default in PDF and Flash formats. Also, it's available in "... other languages/libraries ... (in alphabetical order): cairo, Direct2D, GDI, PDF, PostScript, Quartz, skia, and SVG".

The implementation/support/simulation this functionality without canvas fillRule only using available 2D context functions will not look pretty or intuitive, e.g. something like:

    ctx.rect(10, 10, 100, 40);
    ctx.rect(15, 15, 90, 30);
    ctx.fillRule = 'evenodd';
    ctx.fill();

will look much better than its replacement.

Is it expected to have something like fillRule in the spec?
Comment 1 James Ascroft-Leigh 2012-12-21 01:24:26 UTC
There seems to have been a response on this topic by Ian Hickson:

<blockquote>

  I've taken note of the suggestions below in the source of the HTML5 spec, 
  but not added them to the language yet. As we approach last call for the 
  HTML5 spec, I am trying to reduce the number of new features added, so 
  that we can stabilise the document and feature set and give implementors a 
  fixed set of features to aim for.

     * Colours set by component
     * The equivalent of SVG's fill-rule
     * Line styles -- dashed and dotted lines
     * Points

</blockquote>

See http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-April/019503.html
Comment 2 contributor 2013-01-03 23:38:14 UTC
Checked in as WHATWG revision r7635.
Check-in comment: Introduce canvas 2d context's fillRule attribute
http://html5.org/tools/web-apps-tracker?from=7634&to=7635