X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FHiDPISetting.java;fp=src%2Fjalview%2Fbin%2FHiDPISetting.java;h=3ff683e2eee4cde076e712c8306b547ccc8c84eb;hb=984dbed9af3c4271b4785e197f6574b5f1d7105e;hp=4472a1904acb3e4058a4509d97134f39a0ad305d;hpb=1b7707cc2e5f8c21a9e80e6f3262cb8e5bf4d7b3;p=jalview.git diff --git a/src/jalview/bin/HiDPISetting.java b/src/jalview/bin/HiDPISetting.java index 4472a19..3ff683e 100644 --- a/src/jalview/bin/HiDPISetting.java +++ b/src/jalview/bin/HiDPISetting.java @@ -6,7 +6,7 @@ public class HiDPISetting { private static final int hidpiThreshold = 130; - private static final int tallScreenThreshold = 1300; + private static final int tallScreenThreshold = 1400; private static final String scalePropertyName = "sun.java2d.uiScale"; @@ -26,7 +26,7 @@ public class HiDPISetting public static int dpi = 0; - public static int maxdimension = 0; + public static int mindimension = 0; public static int width = 0; @@ -84,8 +84,8 @@ public class HiDPISetting { int height = Toolkit.getDefaultToolkit().getScreenSize().height; int width = Toolkit.getDefaultToolkit().getScreenSize().width; - // using maxdimension in case of portrait screens - maxdimension = Math.max(height, width); + // using mindimension in case of portrait screens + mindimension = Math.min(height, width); } catch (Throwable t) { System.err.println("Cannot get screen size height and width"); @@ -97,21 +97,21 @@ public class HiDPISetting } else { - // attempt at a formula for scaling based on screen dpi and maxdimension. + // attempt at a formula for scaling based on screen dpi and mindimension. // scale // will be an integer >=1 - if (dpi > 0 && maxdimension > 0) + if (dpi > 0 && mindimension > 0) { scale = Math.min(dpi / hidpiThreshold, - maxdimension / tallScreenThreshold) + 1; + mindimension / tallScreenThreshold) + 1; } - else if (dpi == 0 && maxdimension > tallScreenThreshold) + else if (dpi == 0 && mindimension > tallScreenThreshold) { // dpi couldn't be found but the screen has a large vertical pixel count - scale = maxdimension / tallScreenThreshold + 1; + scale = mindimension / tallScreenThreshold + 1; } - /* do nothing if maxdimension == 0 -- might be just a small HD screen (e.g. Gemini PDA) - else if (maxdimension == 0 && dpi > hidpiThreshold) + /* do nothing if mindimension == 0 -- might be just a small HD screen (e.g. Gemini PDA) + else if (mindimension == 0 && dpi > hidpiThreshold) { } */