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

Region caching fails for some common CSS styles due to image edge conditions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 8
    • 8
    • javafx

    Description

      Application:


      public class HelloRegion extends Application {
          @Override public void start(Stage primaryStage) throws Exception {
              Region region = new Region();
              region.setStyle(
                      "-fx-background-color: gray, yellow;" +
                      "-fx-background-insets: 0, 0 0 0 1;");
              region.setPrefSize(300, 200);
              region.setMaxSize(300, 200);
              StackPane root = new StackPane();
              root.getChildren().add(region);
              Scene scene = new Scene(root, 640, 480);
              primaryStage.setScene(scene);
              primaryStage.show();
          }

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


      Attached screenshots show both "expected" and "actual". The problem here is that the cached image is 2x200 pixels, and when it gets mapped into the final destination space, it runs into image sampling edge conditions.

      Attachments

        1. actual.png
          35 kB
          Richard Bair
        2. expected.png
          35 kB
          Richard Bair

        Activity

          People

            rbair Richard Bair (Inactive)
            rbair Richard Bair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: