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

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:

      Description

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


        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported: