In the following program, resizing the window size across the threshold specified in the media query (300px) results in an interrupted transition. The expected result should be that the -fx-scale-x transition runs smoothly from 2 to 1.
public class InterruptedTransitionBug extends Application {
@Override
public void start(Stage stage) throws Exception {
var root = new StackPane(new Button("My Button"));
var scene = new Scene(root, 600, 200);
scene.getStylesheets().add("data:text/css;base64," + Base64.getEncoder().encodeToString("""
.button {
transition: -fx-scale-x 2s;
}
@media (width > 300px) {
.button {
-fx-scale-x: 2;
}
}
""".getBytes(StandardCharsets.UTF_8)));
stage.setScene(scene);
stage.show();
}
}
public class InterruptedTransitionBug extends Application {
@Override
public void start(Stage stage) throws Exception {
var root = new StackPane(new Button("My Button"));
var scene = new Scene(root, 600, 200);
scene.getStylesheets().add("data:text/css;base64," + Base64.getEncoder().encodeToString("""
.button {
transition: -fx-scale-x 2s;
}
@media (width > 300px) {
.button {
-fx-scale-x: 2;
}
}
""".getBytes(StandardCharsets.UTF_8)));
stage.setScene(scene);
stage.show();
}
}
- links to
-
Review(master)
openjdk/jfx/2038