[whatwg] gradient edge case

Rik Cabanier cabanier at gmail.com
Mon Dec 10 16:46:10 PST 2012


On Mon, Dec 10, 2012 at 4:07 PM, Ian Hickson <ian at hixie.ch> wrote:

> On Sat, 1 Sep 2012, Rik Cabanier wrote:
> >
> > Currently the canvas spec specifies the following:
> >
> > If x0 = x1 and y0 = y1, then the linear gradient must paint nothing.
> >
> > and
> >
> > If x0 = x1 and y0 = y1 and r0 = r1, then the radial gradient must paint
> > nothing
> >
> > Why is this?
>
> At this point: it's what browsers (mostly) do.
>

If this is consistently implemented, it's probably OK.
This 'flicker' type of situations usually points to a problem with the
model.


>
>
> On Sat, 1 Sep 2012, David Dailey wrote:
> >
> > While on the topic, it seems like reflected linear gradients would be
> > quite handy -- insert an "edge" into the stop-sequence and then reflect
> > or repeat from there.
>
> Can't you just do that by listing the colours forwards and backwards?
>
>
> On Sat, 1 Sep 2012, Rik Cabanier wrote:
> >
> > Since Canvas has support for pattern, you could fairly easy emulate this
> > behavior.
> > I think it would be handy if you could add the 'reflect' idiom to
> patterns.
>
> Can't you just make the larger pattern and use that


yes, however it will be slower since the pattern has to be rendered two or
four times.
If you can reflect in x and y, you can calculate the pattern cell once and
then have your hardware do the tiling.



More information about the whatwg mailing list