I expected this to work, but it doesn't draw anything:
final StackPane rootPane = new StackPane();
Text text = new Text("This is a text node");
text.setCache(true);
text.setCacheHint(CacheHint.SPEED);
ScaleTransition scale = new ScaleTransition(Duration.seconds(5), text);
scale.setCycleCount(Animation.INDEFINITE);
scale.setAutoReverse(true);
scale.setFromX(0);
scale.setFromY(0);
scale.setToX(5);
scale.setToY(5);
scale.play();
rootPane.getChildren().add(text);
Scene scene = new Scene(rootPane, 1200, 800);
stage.setScene(scene);
stage.show();
It *should* have rendered the text node at its normal size, and then used this cached version for the subsequent animation. Instead it draws nothing.
final StackPane rootPane = new StackPane();
Text text = new Text("This is a text node");
text.setCache(true);
text.setCacheHint(CacheHint.SPEED);
ScaleTransition scale = new ScaleTransition(Duration.seconds(5), text);
scale.setCycleCount(Animation.INDEFINITE);
scale.setAutoReverse(true);
scale.setFromX(0);
scale.setFromY(0);
scale.setToX(5);
scale.setToY(5);
scale.play();
rootPane.getChildren().add(text);
Scene scene = new Scene(rootPane, 1200, 800);
stage.setScene(scene);
stage.show();
It *should* have rendered the text node at its normal size, and then used this cached version for the subsequent animation. Instead it draws nothing.
- relates to
-
JDK-8088424 Odd animations for cached nodes under various transforms
-
- Open
-