From 1d06ac5a5d254b91c836bf117ff166e734c3c3d0 Mon Sep 17 00:00:00 2001 From: mkpaz Date: Tue, 14 Feb 2023 18:10:21 +0400 Subject: [PATCH] Enable scene anti-aliasing --- sampler/src/main/java/atlantafx/sampler/Launcher.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sampler/src/main/java/atlantafx/sampler/Launcher.java b/sampler/src/main/java/atlantafx/sampler/Launcher.java index dae0d92..df9478e 100755 --- a/sampler/src/main/java/atlantafx/sampler/Launcher.java +++ b/sampler/src/main/java/atlantafx/sampler/Launcher.java @@ -21,8 +21,10 @@ import java.nio.file.Paths; import java.util.List; import java.util.Properties; import javafx.application.Application; +import javafx.application.ConditionalFeature; import javafx.application.Platform; import javafx.scene.Scene; +import javafx.scene.SceneAntialiasing; import javafx.scene.image.Image; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; @@ -54,7 +56,11 @@ public class Launcher extends Application { } var root = new ApplicationWindow(); - var scene = new Scene(root, 1200, 768); + + var antialiasing = Platform.isSupported(ConditionalFeature.SCENE3D) + ? SceneAntialiasing.BALANCED + : SceneAntialiasing.DISABLED; + var scene = new Scene(root, 1200, 768, false, antialiasing); scene.setOnKeyPressed(this::dispatchHotkeys); var tm = ThemeManager.getInstance();