[whatwg] Drawing shapes on canvas

Joe Gregorio jcgregorio at google.com
Thu Jan 30 14:14:00 PST 2014

On Mon, Jan 27, 2014 at 9:28 PM, Rik Cabanier <cabanier at gmail.com> wrote:
> On Mon, Jan 27, 2014 at 3:15 PM, Joe Gregorio <jcgregorio at google.com>wrote:
>> Agreed on the complexity and the interactions. Unfortunately dropping all
>> of them but addPath does seem to leave
>> Path with a hole in functionality since CanvasRenderingContext2D has both
>> a fillText() and strokeText(). How about simplifying
>> to just these two add* methods:
>>   void addPath(Path path, SVGMatrix? transformation);
>>   void addText(DOMString text, SVGMatrix? transformation, unrestricted
>> double x, unrestricted double y, optional unrestricted double maxWidth);
>> Note the removal of the CanvasDrawingStyles from addText.
> Unfortunately, that doesn't really help.
>  For instance, let's say you request the path for the letter 'o'. It's
> represented by 2 closed paths.
> What winding rule should you use when you fill that path? Should the paths
> be oriented so you have to use a NZO fill or so you can use any winding
> rule?
> What happens if the path for a letter intersect with another path (or
> another letter)?

OK, I'm convinced that's going to be not very useful for filling if there
aren't some
guarantees about the winding of the resulting path, which is a hard problem.
So I'm fine with just sticking to addPath, which I think was your original
proposal ;-)

  void addPath(Path path, SVGMatrix? transformation);

More information about the whatwg mailing list