Re: [CSSWG] Minutes and Resolutions 2009-02-04: box-shadow and border-image

On Feb 13, 2009, at 5:33 AM, Tab Atkins Jr. wrote:

> If you use manhattan distance (the easiest and fastest distance), you
> maintain sharp corners.

You are assuming 90 degree angles, aren't you? How can a 20 degree  
angle retain a sharp point with a non-vector based spread applied to  
it? I don't think it would, but I'd be happy to be proved wrong. Can  
you show any samples?

> You only lose them when you use euclidean
> distance (much slower, because it involves two multiplications and a
> square root), or something similar.  Photoshop seems to use a
> Euclidean distance, since it specifically refers to a 'radius'.  Under
> a manhattan distance metric, a 'circle' is square.  ^_^

I wouldn't want my circular shadows to become square shadows, or to  
have smooth diagonals turn into a series of giant blocks.

> I'm perfectly happy with the result of keeping corners sharp, and the
> fact that it matches up with what is probably the most performant
> method (I only say 'probably' because I don't know exact details of
> the rendering engines, but I'm nearly certain I'm right) is just an
> added bonus.

As I understand the manhattan distance idea (very limited, after  
Googling it and reading for just a couple minutes), it would not  
produce smooth edges or sharp points. I am very happy with the way  
PhotoShop does it, and find it very difficult to believe that  
manhattan distance calculations would be an improvement on anything  
but speed.

I really don't know what the difference in speed would be, or if it is  
a significant improvement or if the speed of an optimized euclidean  
method is an important factor. I think the speed improvement would  
have to be extremely significant and the speed of the other method way  
too slow, if manhattan distance would result in much uglier shadows  
(as I would expect, given my limited understanding and no visual aids).

Received on Friday, 13 February 2009 16:04:44 UTC