Radial gradient used as a Stroke

Jim Graham james.graham at oracle.com
Mon May 7 11:58:55 PDT 2012


Hi Jiri,

Can you clarify the problem you are seeing?

			...jim

On 5/5/2012 2:38 AM, goddard at seznam.cz wrote:
> Thanks Jim :) What about that artifact looking like a 1px stroke between
> the circle and the actual stroke?
>
> Jiri
>
> ------------ Původní zpráva ------------
> Od: Jim Graham <james.graham at oracle.com>
> Předmět: Re: Radial gradient used as a Stroke
> Datum: 05.5.2012 01:33:24
> ----------------------------------------
> For A.setClip(B), any pixel that B would render to is used as a mask to
> control where A is rendered to. The colors that B renders are ignored
> completely except for their alpha. The alpha controls the amount of
> masking it performs, but the color is discarded.
>
> So, the stroke on the circle shouldn't "appear" as a gradient filled
> ring - instead that ring will simply contribute to the area that you can
> see the underlying Rectangle through.
>
> So, if you are assigning a gradient of opaque colors to that circle's
> stroke and then installing the circle as a clip, you might as well just
> set the circle's stroke to an opaque Color instead.
>
> If you want to have a circular clip and you want to render the stroke of
> that circular region, then you'll have to use 2 nodes - one to install
> as a clip, and another one on top of it all to paint the border...
>
> ...jim
>
> On 5/4/2012 11:18 AM, goddard at seznam.cz wrote:
>> Hello,
>>
>> I've got this piece of code
> https://github.com/g0dd4rd/TKE/blob/master/src/tke/Encounter.java where
> I use
> Circle as a clip for Rectangle to see the background. The Circle has a
> Stroke,
> but this Stroke is not shown when used with a clip.
>> Does it work as designed?
>> My goal is to use RadialGradient as a Stroke. I haven't found an issue
>> for it
> for JIRA, so I'm asking here.
>>
>> Regards, Jiri
>
>


More information about the openjfx-dev mailing list