StyleHelper.resetToInitialValues() interrupts animated properties

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: jfx25
    • Component/s: javafx
    • None
    • In Review

      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();
          }
      }

            Assignee:
            Michael Strauß
            Reporter:
            Michael Strauß
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: