From: soares Date: Fri, 22 May 2020 11:56:04 +0000 (+0100) Subject: JAL-3609 corrected maxdimension to mindimension. Adjusted tallscreen limit X-Git-Tag: Develop-2_11_2_0-d20201215~15^2~42 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=984dbed9af3c4271b4785e197f6574b5f1d7105e JAL-3609 corrected maxdimension to mindimension. Adjusted tallscreen limit --- diff --git a/getdown/lib/getdown-core.jar b/getdown/lib/getdown-core.jar index 764dbc6..ca1ebe8 100644 Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ diff --git a/getdown/lib/getdown-launcher-local.jar b/getdown/lib/getdown-launcher-local.jar index 50d9d57..be291c5 100644 Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index 7f3df08..8e17141 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java b/getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java index 4472a19..3ff683e 100644 --- a/getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java +++ b/getdown/src/getdown/core/src/main/java/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) { } */ diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index 764dbc6..ca1ebe8 100644 Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ diff --git a/j8lib/getdown-core.jar b/j8lib/getdown-core.jar index 764dbc6..ca1ebe8 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ 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) { } */