Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: bITs.EA on January 18, 2017, 03:22:58 am

Title: shapescript: add gradient to shape
Post by: bITs.EA on January 18, 2017, 03:22:58 am
Hi

Is it possible to add a gradient property to a "fill-command"? Nativeshapes have gradient in their color, but custom shapes don't...

Thanks

Grts

S
Title: Re: shapescript: add gradient to shape
Post by: Eve on January 18, 2017, 09:04:05 am
For my tests, shapes drawn by a top level shape are drawn with gradients, but subshapes they are disabled.
Title: Re: shapescript: add gradient to shape
Post by: KP on January 18, 2017, 09:24:12 am
I noticed that something like this

Code: [Select]
shape main
{
    ellipse(0,0,100,100);
}

doesn't have a gradient fill, but if you put it inside a path

Code: [Select]
shape main
{
    startpath();
    ellipse(0,0,100,100);
    endpath();
    fillandstrokepath();
}

it does have a gradient fill.
Title: Re: shapescript: add gradient to shape
Post by: Paolo F Cantoni on January 18, 2017, 10:47:59 am
I noticed that something like this

Code: [Select]
shape main
{
    ellipse(0,0,100,100);
}

doesn't have a gradient fill, but if you put it inside a path

Code: [Select]
shape main
{
    startpath();
    ellipse(0,0,100,100);
    endpath();
    fillandstrokepath();
}

it does have a gradient fill.
Pure EAUI!

(at least it's not boring...  You never know what gotcha is round the next corner...)

Paolo
Title: Re: shapescript: add gradient to shape
Post by: qwerty on January 18, 2017, 11:09:22 am
As we all know, the Easter bunny has its home on planet Sparx.

q.
Title: Re: shapescript: add gradient to shape
Post by: bITs.EA on January 19, 2017, 08:55:49 pm
Check! The startpath()/endpath() solution works like a charm.