-
Notifications
You must be signed in to change notification settings - Fork 146
JDK-8211294: [windows] TextArea content is blurry with 125% scaling #225
Comments
I can reproduce this on my Win 7 machine with 125% scaling, too. |
Filed in JBS as JDK-8211294. I slightly modified the test case so that the label is rendered and so the TextField and TextArea are initially populated with text. |
I encountered the same Problem on Windows 10 1803 Enterprise and Windows 10 1809 Pro using openjfx 11.0.2 and 12-ea+12. The blurring is not limited to labels but can also be seen with images and not only happens on 125% but everyhting else than 100% (so 125%, 150%, 175%). What I also found is that creating a scene with a fixed size of pixels is not the same for different scales, I don't know if this is intended behaviour or part of the same bug? This can be fixed by scaling the width and heigth of the scene by Interestingly using Oracle's Java 1.8 I seem to only have scaling issues on 150% and 175% but it works fine on 100% and 125%. |
That's because the threshold for using Hi-DPI on JDK 8 is 150% (versus 125% on JDK 9 and later). |
Ah, ok. So is the perceived bluriness and scene scaling a bug or intended beahviour? |
Workaround for this issue: Add css: .text-area > .scroll-pane {
-fx-skin: "MyScrollPaneSkin"
} Add java code: public class MyScrollPaneSkin extends ScrollPaneSkin {
public MyScrollPaneSkin(final ScrollPane scrollpane) {
super(scrollpane);
try {
Field viewRectField = ScrollPaneSkin.class.getDeclaredField("viewRect");
viewRectField.setAccessible(true);
StackPane viewRect = (StackPane) viewRectField.get(this);
viewRect.setCache(false);
} catch (Exception e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "failed to disable scroll pane cache", e);
}
}
} |
@thomas-andres Thank you. It's a great solution. How did you thought the wonderfual soluation? |
I ran into a similar issue last year, where Font's where blurred inside a scroll pane and found this post: https://stackoverflow.com/questions/26098295/scrollpane-content-becomes-blurry-after-dragging |
Note that this GitHub issue tracker is not actively tracked or managed. |
Workarounds should not be necessary with versions newer than openjfx16 anymore according to https://bugs.openjdk.java.net/browse/JDK-8211294 |
Test Code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class HelloFX extends Application {
}
Environment:
win 10
scale :125%
oracle jdk11
By the way, how can I chang the cursor(I) style and make font rendering better?
The text was updated successfully, but these errors were encountered: