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

Re: [whatwg] Proposal: Add CanvasRenderingContext2D.fillRule with "nonzero" (default) and "evenodd" options

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 09 Jan 2013 20:19:51 -0500
Message-ID: <50EE1737.5020406@mit.edu>
To: whatwg@lists.whatwg.org
On 1/9/13 6:56 PM, James Ascroft-Leigh wrote:
> How can the presence of the winding rule parameter of the fill() and clip()
> operations be detected by client code?

This is a case where .length including optional arguments would have 
been useful.  :(

That said, you can detect this via hacks like this, I expect:

   var ruleArgSupported = false;
   try {
     ctx.fill({ defaultValue: function() { ruleArgSupported = true; 
return false; } });
   } catch (e) {
     // Really shouldn't happen, but who knows
   }

-Boris
Received on Thursday, 10 January 2013 01:20:19 GMT

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