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

Re: [whatwg] [canvas] inner shadows

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 23 Nov 2012 22:36:08 +0000 (UTC)
To: Tyler Larson <talltyler@gmail.com>
Message-ID: <Pine.LNX.4.64.1211232233510.15705@ps20323.dreamhostps.com>
Cc: whatwg@whatwg.org
On Fri, 21 Sep 2012, Tyler Larson wrote:
> On Sep 20, 2012, at 6:49 PM, Ian Hickson <ian@hixie.ch> wrote:
> > Can't you do this using clip() easily enough? Maybe I'm missing 
> > something important here. Can you elaborate?
> Here is an example of what I am talking about. 
> http://i.imgur.com/Sy4xM.png
> Clip would mask something but adding an inner shadow is different and 
> pretty difficult to reproduce when you take into account complex shapes.

Ah, yeah, I see what you mean. The problem is that the canvas rendering 
model always renders the shadow under the shape, and uses the shape's 
alpha to work out where to paint the shape.

What we could do is offer control that would change the shadows from 
rendering under the shape to rendering over the shape, or, maybe even 
better, have a mode that only renders the shadows. Then you could achieve 
these effects relatively easily (by clipping to the shape so that the 
shadow only renders inside the shape).

Is this something implementors would be interested in?

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 23 November 2012 23:04:37 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:48 UTC