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

Region cache not good (draws blurry) for non grid-aligned regions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8
    • javafx

      This is enough to show the problem:

      public void start(Stage primaryStage) throws Exception {
          primaryStage.setScene(new Scene(createContent()));
          primaryStage.show();
      }

      public Parent createContent() {
          Region r = new Region();
          r.setPrefSize(30.5, 30);
          BackgroundFill bf1 = new BackgroundFill(Color.BLACK, null, null);
          r.setBackground(new Background(bf1, bf1));//adding the same fill twice to enable caching
          r.setLayoutX(10);
          r.setLayoutY(10);
          return new Pane(r);
      }

      Note the last column in the region should be gray, but is pure black (in fact, the last column is not rendered).
      change
      r.setBackground(new Background(bf1, bf1));
      to
      r.setBackground(new Background(bf1));
      will disable region cache and result in correct rendering.

        1. BAD-RT34055.png
          15 kB
          Felipe Heidrich
        2. GOOD-RT34055.png
          15 kB
          Felipe Heidrich

            Unassigned Unassigned
            fheidric Felipe Heidrich (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Imported: