W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2012

Re: [whatwg] [canvas] inner shadows

From: Ian Hickson <ian@hixie.ch>
Date: Sat, 24 Nov 2012 16:36:34 +0000 (UTC)
To: Rik Cabanier <cabanier@gmail.com>
Message-ID: <Pine.LNX.4.64.1211241635010.29456@ps20323.dreamhostps.com>
Cc: whatwg@whatwg.org
On Sat, 24 Nov 2012, Rik Cabanier wrote:
> > >
> > > How about the strokes?
> >
> > The example in the OP didn't have them, but you'd have to include them 
> > in the fill area. With the new Path objects, you'd just use 
> > addPathByStrokingPath(), which would be relatively simple.
> 
> Unfortunately the winding rules will mess up your shape. (non-zero 
> winding)
> 
> Take for instance a stroked circle. The stroke which is added with 
> addPathByStrokingPath will always create a hole so you end up with a 
> donut instead of just a slightly larger circle.

Right:

> > So long as they don't overlap, that's not generally a problem. But 
> > sure, for some complex shapes you'd need some new feature or other, 
> > whether it's in shadows or path construction or elsewhere.

In the case of a circle, if you wanted to draw the inner shadow over the 
stroke and the fill, you'd have to create the path as just a fill with the 
radius increased by half the line width.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Saturday, 24 November 2012 18:14:00 GMT

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