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

LCD text not rendering on cached node unless background is set

XMLWordPrintable

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

      If Parent has no background, is cached (Node#setCache(true)), and has LCD Text inside, then the Text will fail to render LCD.
      In the NG layer that maps to NGRegion to renders to cache (NGNode#renderCached).
      When this NGRegion has a NGText descent, then LCD sampling fails.
      If you stick another NGRegion with a background between the cached NGRegion and NGText then it all works.

      Note that is a common in Controls (as all controls are cached).

      Testcase:
      void start(Stage stage) {
          Text text1 = new Text("text1");
          text1.setFontSmoothingType(FontSmoothingType.LCD);
          Text text2 = new Text("text2");
          text2.setFontSmoothingType(FontSmoothingType.LCD);
          StackPane label1 = new StackPane(text1);
          StackPane label2 = new StackPane(text2);
          label2.setBackground(new Background(new BackgroundFill(Color.web("#EEEEEE"),
                                                                 null, null)));

          Pane panel = new VBox(label1, label2);
          Pane scrollPane = new Pane(panel);
          scrollPane.setCache(true);//kills LCD for text1, text2 is okay as label2 has a background set
          Scene s = new Scene(scrollPane, 200, 200);
          stage.setScene(s);
          stage.show();
      }

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

              Created:
              Updated:
              Imported: