{
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";
public static int dpi = 0;
- public static int maxdimension = 0;
+ public static int mindimension = 0;
public static int width = 0;
{
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");
}
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)
{
}
*/
{
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";
public static int dpi = 0;
- public static int maxdimension = 0;
+ public static int mindimension = 0;
public static int width = 0;
{
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");
}
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)
{
}
*/