Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8102847

Need a way to avoid jittery, pixelated text when scaling a Label or Text node in an animation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx

      When a Label is in a ScaleTransition the text jumps around and also seems to lose its antialising (or at least doesn't look overly smooth).


      public class TextAnimateApp extends Application {

          public static void main(String[] args) throws Exception {
              launch(args);
          }

          public void start(Stage stage) throws Exception {

              final StackPane rootPane = new StackPane();

              Label label = new Label("This is a label");
              label.setStyle("-fx-font-scale: 30");
              ScaleTransition scale = new ScaleTransition(Duration.seconds(5), label);
              scale.setCycleCount(Animation.INDEFINITE);
              scale.setAutoReverse(true);
              scale.setFromX(0);
              scale.setFromY(0);
              scale.setToX(5);
              scale.setToY(5);
              scale.play();
              rootPane.getChildren().add(label);

              Scene scene = new Scene(rootPane, 1200, 800);
              stage.setScene(scene);
              stage.show();
          }
      }


            fheidric Felipe Heidrich (Inactive)
            dzwolenskjfx Daniel Zwolenski (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: