[whatwg] Canvas: even-odd winding rule fills

Rik Cabanier cabanier at gmail.com
Wed Jan 2 11:59:46 PST 2013

yes, your particular use case was easy.
However, just look at how stroke is implemented in the Canvas 2d spec or
how you can create paths by stroking or stroked text. They're all affected
by the winding rules.
(The description on how to do strokes in the spec is very wrong, but that
can be addressed later)

Dirk and I did a bit more research and found that SVG, PDF, Flash,
PostScript, Skia, Core Graphics and Direct2D all have the winding rules as
part of the fill operator. It seems strange that canvas would choose to
have a different interface...

On Wed, Jan 2, 2013 at 11:15 AM, James Ascroft-Leigh <jwal at jwal.me.uk>wrote:

> Actually, fillRule was really trivial to implement since the underlying
> graphics context already had that as a Boolean state attribute.  All I
> needed to do was expose the existing attribute through the canvas API IDL.
>  Take a look at the patch and notice how it doesn't actually add any new
> functionality, just really thin API translation functions.

More information about the whatwg mailing list