W3C home > Mailing lists > Public > www-style@w3.org > August 2009

Gradients by angle (was Re: [CSSWG] Minutes and Resolutions 2009-08-12)

From: L. David Baron <dbaron@dbaron.org>
Date: Thu, 13 Aug 2009 15:14:50 -0700
To: www-style@w3.org
Message-ID: <20090813221450.GA1964@pickering.dbaron.org>
On Friday 2009-08-14 09:24 +1200, Robert O'Callahan wrote:
> In linear-gradient, using an angle for the end position means drawing a ray
> along that angle starting at the first position and using that ray's
> intersection with the edge of the background positioning area as the end
> position. (We'd have to define the interpretation of the angle, I'm leaving
> that open.)

That definition of angles doesn't lead to symmetric results.

Consider the image here:
http://lists.w3.org/Archives/Public/www-archive/2009Aug/att-0041/gradient.png
In this image:
 * the dark blue box is the boundary of the box
 * the white->black area is the area covered by the gradient
 * the red area is the area outside the gradient
 * the line blue line is the ray given by your proposal

Here, I use "top left" as the first position.  But unless the angle
given is 45deg (or that plus some multiple of 90deg), a gradient in
this square won't actually have the gradient area touch both
corners.  In this example, the red area extends well into the box at
the bottom right corner.


Now, I'm not sure what the desired behavior for angle gradients is.
Is it that the gradient extends such that it runs from one corner of
the background positioning area to the other, which means there may
not be a single line at the gradient angle that shows the whole
gradient?  Or should there be such a line somewhere within the box,
and if so, where?

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Thursday, 13 August 2009 22:15:27 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:20 GMT