Clamp display scale

This commit is contained in:
crschnick
2026-04-19 12:11:28 +00:00
parent 01625eedbf
commit 227887a3f2
2 changed files with 15 additions and 0 deletions
@@ -31,6 +31,19 @@ public class AppDisplayScale {
}
}
public static Integer clampValue(Integer input) {
if (input == null) {
return null;
}
var rest = input % 25;
if (rest == 0) {
return input;
}
return input - rest;
}
public static boolean hasOnlyDefaultDisplayScale() {
return defaultDisplayScale != null ? defaultDisplayScale : false;
}
@@ -804,6 +804,8 @@ public final class AppPrefs {
}
private void fixLocalValues() {
uiScale.setValue(AppDisplayScale.clampValue(uiScale.getValue()));
if (AppDistributionType.get() == AppDistributionType.WEBTOP) {
performanceMode.setValue(true);
} else if (System.getProperty("os.name").toLowerCase().contains("server")) {