W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2013

Re: [whatwg] Canvas: even-odd winding rule fills

From: Rik Cabanier <cabanier@gmail.com>
Date: Wed, 2 Jan 2013 11:59:46 -0800
Message-ID: <CAGN7qDBNxHcPyKGH8ZYz9h-EAPbfc6gA8tt08=1rLnhYE8_HhA@mail.gmail.com>
To: James Ascroft-Leigh <jwal@jwal.me.uk>
Cc: whatwg@whatwg.org
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@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.
>
Received on Wednesday, 2 January 2013 20:00:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:12 GMT