-
Bug
-
Resolution: Fixed
-
P3
-
8u20
-
Mac OS X 10.9.4
This simple animation of a path node over a rect node with lighting effect leaves a trail of rendering artifacts.
import javafx.animation.RotateTransition;
import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.effect.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;
import javafx.stage.Stage;
import javafx.util.Duration;
public class DrawTurd extends Application {
public void start(Stage aStage)
{
// Creat background rect with lighting effect
Rectangle rect = new Rectangle(0,0,500,400); rect.setFill(Color.YELLOW);
Light.Distant light = new Light.Distant(); light.setAzimuth(60); light.setElevation(120);
Lighting lighting = new Lighting(); lighting.setLight(light); lighting.setSurfaceScale(10);
rect.setEffect(lighting);
// Create foreground path triangle with rotation transition animation
Path path = new Path();
path.getElements().add(new MoveTo(100,100)); path.getElements().add(new LineTo(180,180));
path.getElements().add(new LineTo(260,100)); path.getElements().add(new ClosePath());
path.setFill(Color.RED); path.setStroke(Color.BLACK);
RotateTransition rt = new RotateTransition(Duration.millis(3000), path);
rt.setByAngle(180); rt.setCycleCount(4); rt.setAutoReverse(true); rt.play();
// Create group, add nodes, set scene root, show stage
Group group = new Group(rect, path);
aStage.setScene(new Scene(group));
aStage.show();
}
}
import javafx.animation.RotateTransition;
import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.effect.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;
import javafx.stage.Stage;
import javafx.util.Duration;
public class DrawTurd extends Application {
public void start(Stage aStage)
{
// Creat background rect with lighting effect
Rectangle rect = new Rectangle(0,0,500,400); rect.setFill(Color.YELLOW);
Light.Distant light = new Light.Distant(); light.setAzimuth(60); light.setElevation(120);
Lighting lighting = new Lighting(); lighting.setLight(light); lighting.setSurfaceScale(10);
rect.setEffect(lighting);
// Create foreground path triangle with rotation transition animation
Path path = new Path();
path.getElements().add(new MoveTo(100,100)); path.getElements().add(new LineTo(180,180));
path.getElements().add(new LineTo(260,100)); path.getElements().add(new ClosePath());
path.setFill(Color.RED); path.setStroke(Color.BLACK);
RotateTransition rt = new RotateTransition(Duration.millis(3000), path);
rt.setByAngle(180); rt.setCycleCount(4); rt.setAutoReverse(true); rt.play();
// Create group, add nodes, set scene root, show stage
Group group = new Group(rect, path);
aStage.setScene(new Scene(group));
aStage.show();
}
}
- relates to
-
JDK-8097538 NPE when chaining Lighting effect with other effects
- Resolved