-
Bug
-
Resolution: Unresolved
-
P4
-
8
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();
}
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();
}
- duplicates
-
JDK-8123410 Mac inconstant with LCD and Grayscale text
-
- Closed
-
- relates to
-
JDK-8095481 ScrollPane shouldn't always have setCache(true)
-
- Closed
-