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

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 UTC