mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-05-29 07:20:35 +00:00
Clamp display scale
This commit is contained in:
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user