This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 19932 - Proposal: Add CanvasRenderingContext2D.fillRule
Summary: Proposal: Add CanvasRenderingContext2D.fillRule
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-10 16:15 UTC by Yury
Modified: 2013-01-03 23:38 UTC (History)
5 users (show)

See Also:


Attachments

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