Re: Canvas gradient comments

On Wed, 7 May 2008, Philip Taylor wrote:
> 
> "The createLinearGradient(x0, y0, x1, y1) method takes four arguments 
> that, after being subjected to the current transformation matrix, 
> represent the start point (x0, y0) and end point (x1, y1) of the 
> gradient." - that doesn't match reality. All implementations use the CTM 
> at fill/stroke time, not at create(Linear|Radial)Gradient time.

Fixed.


> The behaviour outside the 0/1 stops is specified redundantly. The 
> CanvasGradient bit says "Before the first stop, the color must be the 
> color of the first stop". (That's not limited to the range [0, 1], as I 
> read it). createLinearGradient says "at and before the starting point on 
> the canvas the color at offset 0 is used". createRadialGradient says 
> "Let the color at ω be the color of the gradient at offset 0.0 for all 
> values of ω less than 0.0". Since linear and radial gradients have the 
> same behaviour, it seems sensible to keep the CanvasGradient definition 
> (and maybe be clear that it's not limited to [0, 1]) and delete the 
> other two.

Fixed.


> "When there are no stops, the gradient is transparent black." - should 
> say "must be".

Nah, that's a definition, not a requirement. The requirement is in the 
rendering bits.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 13 June 2008 08:25:03 UTC