Page 1 of 1

FillGradient no good work with balance

Posted: Wed Oct 31, 2018 4:43 pm
by sinisrus
Hello,

I have problem with Fillgradient and ballance

Test 1 Ballance work 0.0 at 0.9 if balance=1 =>no work
Test 2 if i use colors table balance => no work

Code: Select all

/*Test 1*/
SetFillStyle(#FILLGRADIENT, #CONICAL, #RED,#BLUE,0,{balance=1})
BOX(50,5,100,100,#BLACK)

/*Test 2*/
SetFillStyle(#FILLGRADIENT, #CONICAL, 0,0,0, {balance=1,Colors = {#RED, 0,#BLUE, 1}})
BOX(50,150,100,100,#BLACK)
Thank you

Re: FillGradient no good work with balance

Posted: Wed Oct 31, 2018 9:59 pm
by airsoftsoftwair
Once again, you need to be more precise in your reports. What do you expect and what do you get? Just saying "no work" doesn't really help much...

Re: FillGradient no good work with balance

Posted: Thu Nov 01, 2018 12:39 am
by sinisrus
Test my script and change balance value for look the problem
I sorry is not possible for me to say more juste balance no work correctly :-/

Re: FillGradient no good work with balance

Posted: Thu Nov 01, 2018 5:18 pm
by airsoftsoftwair
Well, then post a picture of what you expect the conical gradient to look like with balance 1.0 and what it currently looks like. I've tried your script and I still don't see the problem.

Re: FillGradient no good work with balance

Posted: Fri Nov 02, 2018 1:02 am
by sinisrus
Ok after test only FillGradient with balance no work if use colors table

Code: Select all

BeginDoubleBuffer(True) 

i=0
Function p_Move()
cls()
IF i>10 then i=0

SetFillStyle(#FILLGRADIENT, #CONICAL, #RED,#BLUE,0,{Balance=i*0.1})
BOX(10,5,50,50,#BLACK)
Textout(65,25,"Work "..i*0.1)

SetFillStyle(#FILLGRADIENT, #CONICAL, 0,0,0, {balance=i*0.1,Colors = {#RED, 0,#BLUE, 1}})
BOX(10,65,50,50,#BLACK)
Textout(65,85,"No work "..i*0.1)

Flip()
i=i+1
EndFunction

SetInterval(1, p_Move, 1000/5) ; 50fps
 

/* Boucle infinie */
Repeat
        WaitEvent
Forever

Re: FillGradient no good work with balance

Posted: Fri Nov 02, 2018 3:04 pm
by airsoftsoftwair
Thanks, now I see what you mean. Will be fixed.

Re: FillGradient no good work with balance

Posted: Sat Nov 03, 2018 12:02 am
by sinisrus
Thank you for your patience ;)

Re: FillGradient no good work with balance

Posted: Sun Dec 09, 2018 2:22 pm
by airsoftsoftwair
Ok, so that's rather a bug in the documentation. "Balance" is ignored for #CONICAL when using multiple colors because in that case the balancing between the individual colors in the "Colors" table is defined by the individual color stops in that table. Relating to your example, it can be fixed like this then:

Code: Select all

SetFillStyle(#FILLGRADIENT, #CONICAL, 0,0,0, {balance=i*0.1,Colors = {#BLUE, 0,#RED, i*0.1,#BLUE,1}})
Then it'll work correctly. I'll also adapt the doc to mention that "Balance" is ignored if #CONICAL is used with multiple colors.