From 430309a3f91fd145b83daa51bd5035a26af080a7 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 25 Jan 2017 22:17:43 +0100 Subject: [PATCH] WIP windows menu scaling --- src/dorkbox/systemTray/util/ImageUtils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dorkbox/systemTray/util/ImageUtils.java b/src/dorkbox/systemTray/util/ImageUtils.java index 7eea44c..d2260b1 100644 --- a/src/dorkbox/systemTray/util/ImageUtils.java +++ b/src/dorkbox/systemTray/util/ImageUtils.java @@ -68,8 +68,8 @@ class ImageUtils { public static void determineIconSize() { - int trayScalingFactor = 0; - int menuScalingFactor = 0; + double trayScalingFactor = 0; + double menuScalingFactor = 0; if (SystemTray.AUTO_TRAY_SIZE) { if (OS.isWindows()) { @@ -138,7 +138,7 @@ class ImageUtils { // casting around for rounding/math stuff // *2 because we want a 2x scale to be 64, not 32. trayScalingFactor = (int) (((double) dpiX) / ((double) 96)) * 2; - menuScalingFactor = trayScalingFactor; + menuScalingFactor = (int) (((double) dpiX) / ((double) 96)); } @@ -276,13 +276,13 @@ class ImageUtils { // the DEFAULT scale is 16 if (trayScalingFactor > 1) { - TRAY_SIZE = SystemTray.DEFAULT_TRAY_SIZE * trayScalingFactor; + TRAY_SIZE = (int) (SystemTray.DEFAULT_TRAY_SIZE * trayScalingFactor); } else { TRAY_SIZE = SystemTray.DEFAULT_TRAY_SIZE; } if (menuScalingFactor > 1) { - ENTRY_SIZE = SystemTray.DEFAULT_MENU_SIZE * menuScalingFactor; + ENTRY_SIZE = (int) (SystemTray.DEFAULT_MENU_SIZE * menuScalingFactor); } else { ENTRY_SIZE = SystemTray.DEFAULT_MENU_SIZE; }