JAL-3609 corrected maxdimension to mindimension. Adjusted tallscreen limit
authorsoares <bsoares@dundee.ac.uk>
Fri, 22 May 2020 11:56:04 +0000 (12:56 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 6 Nov 2020 15:46:40 +0000 (15:46 +0000)
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher-local.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java
j11lib/getdown-core.jar
j8lib/getdown-core.jar
src/jalview/bin/HiDPISetting.java

index 764dbc6..ca1ebe8 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index 50d9d57..be291c5 100644 (file)
Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ
index 7f3df08..8e17141 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index 4472a19..3ff683e 100644 (file)
@@ -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)
       {
       }
       */
index 764dbc6..ca1ebe8 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index 764dbc6..ca1ebe8 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ
index 4472a19..3ff683e 100644 (file)
@@ -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)
       {
       }
       */