Skip to main content

RadialGradient problem !?

7 replies [Last post]
asimbalak
Offline
Joined: 2008-08-04
Points: 0

Hi,

does anyone knows why the RadialGradient do not follow the circle when moving, check the following example to get the idea:

<br />
import javafx.input.*;<br />
import javafx.application.*;</p>
<p>import javafx.scene.paint.*;<br />
import javafx.scene.geometry.*;</p>
<p>import java.lang.System;</p>
<p>var x = 100.0;<br />
var y = 30.0;</p>
<p>Frame {<br />
    title: "Circle"<br />
    width:  300<br />
    height: 200<br />
    stage: Stage{<br />
        content: Circle {<br />
            centerX: bind x<br />
            centerY: bind y<br />
            radius: 25<br />
            fill: RadialGradient {<br />
                centerX: bind x<br />
                centerY: bind y<br />
                radius: 50<br />
                proportional: false<br />
                stops: [<br />
                    Stop {offset: 0.0 color: Color.WHITE},<br />
                    Stop {offset: 0.5 color: Color.BLUE},<br />
                    Stop {offset: 1.0 color: Color.DARKORANGE},<br />
                ]<br />
            }<br />
            onMouseDragged: function(e:MouseEvent) {<br />
                    x = e.getX();<br />
                    y = e.getY();<br />
                }</p>
<p>        }<br />
    }<br />
    visible: true<br />
}<br />

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
asimbalak
Offline
Joined: 2008-08-04
Points: 0

I do not have an account to open a jira issue.

So please if someone have an account add this issue.

Thanks.

michael_heinrichs
Offline
Joined: 2007-11-15
Points: 0

You can simply create an account.

asimbalak
Offline
Joined: 2008-08-04
Points: 0

You are totally right!

I had no idea that anyone could create an account.

Thanks for pointing it out.

alexsch
Offline
Joined: 2007-07-12
Points: 0

Please, create a JIRA issue on it: http://openjfx.java.sun.com/jira/secure/CreateIssue!default.jspa

It does not work because the triggers are not set for the centerX and centerY attributes of RadialGradient class.

mklaury
Offline
Joined: 2008-08-05
Points: 0

... And how can we do this ?

alexsch
Offline
Joined: 2007-07-12
Points: 0

Developers can do it:

[code]
public class RadialGradient extends Paint {

public attribute centerX:Number = 0.0 on replace{
// set new centerX
};

public attribute centerY:Number = 0.0 on replace{
// set new centerY
};

}
[/code]

asimbalak
Offline
Joined: 2008-08-04
Points: 0

Hi,

Even though I added the replace trigger to the RadialGradient class it still do not move around with the circle. Using debugger I confirmed that the centerX and centerY do get the new values.

I am not sure but I think it should be repainted in the new position and setting the new values to centerX and centerY is not enough.

Any suggestion?