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

Re: [whatwg] Drawing shapes on canvas

From: Joe Gregorio <jcgregorio@google.com>
Date: Thu, 30 Jan 2014 17:14:00 -0500
Message-ID: <CAA6qSUAtUy3booKdmq3LMLo_QMGobie0X9eS03dKFzEJY8uR_g@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: whatwg <whatwg@lists.whatwg.org>
On Mon, Jan 27, 2014 at 9:28 PM, Rik Cabanier <cabanier@gmail.com> wrote:
> On Mon, Jan 27, 2014 at 3:15 PM, Joe Gregorio <jcgregorio@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);
Received on Thursday, 30 January 2014 22:14:44 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:15 UTC