From 9429ba7d489d64d4547259ac85fb416dcf12ba67 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Tue, 31 Mar 2020 12:17:05 +0200 Subject: [PATCH] support specifying custom scale factor in system property `flatlaf.uiScale` also for Java 9 and later --- CHANGELOG.md | 2 ++ .../src/main/java/com/formdev/flatlaf/util/UIScale.java | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c2c165a..ffa4d9e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ FlatLaf Change Log - Support changing default font used for all components with automatic scaling UI if using larger font. Use `UIManager.put( "defaultFont", myFont );` - No longer use system property `sun.java2d.uiScale`. (Java 8 only) +- Support specifying custom scale factor in system property `flatlaf.uiScale` + also for Java 9 and later. - Demo: Support using own FlatLaf themes (`.properties` files) that are located in working directory of Demo application. Shown in the "Themes" list under category "Current Directory". diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java index 8ae5250d..2338f25e 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java @@ -204,9 +204,6 @@ public class UIScale * to the given font. */ public static FontUIResource applyCustomScaleFactor( FontUIResource font ) { - if( UIScale.isSystemScalingEnabled() ) - return font; - String uiScale = System.getProperty( "flatlaf.uiScale" ); float scaleFactor = parseScaleFactor( uiScale ); if( scaleFactor <= 0 )