Index: /trunk/src/org/openstreetmap/josm/gui/util/GuiSizesHelper.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/util/GuiSizesHelper.java	(revision 10391)
+++ /trunk/src/org/openstreetmap/josm/gui/util/GuiSizesHelper.java	(revision 10392)
@@ -5,4 +5,6 @@
 import java.awt.HeadlessException;
 import java.awt.Toolkit;
+
+import org.openstreetmap.josm.Main;
 
 /**
@@ -20,19 +22,23 @@
 
     /** cache value for screen resolution */
-    private static int screenDPI = -1;
+    private static float screenDPI = -1;
 
     /** Request the screen resolution (cached)
      * @return screen resolution in DPI
      */
-    private static int getScreenDPI() {
+    private static float getScreenDPI() {
         if (screenDPI == -1) {
             synchronized (GuiHelper.class) {
                 if (screenDPI == -1) {
-                    try {
-                        screenDPI = Toolkit.getDefaultToolkit().getScreenResolution();
-                    } catch (HeadlessException e) {
-                        screenDPI = 96;
+                    float scalePref = (float) Main.pref.getDouble("gui.scale", 0);
+                    if (scalePref != 0) {
+                        screenDPI = 96f * scalePref;
+                    } else {
+                        try {
+                            screenDPI = Toolkit.getDefaultToolkit().getScreenResolution();
+                        } catch (HeadlessException e) {
+                            screenDPI = 96;
+                        }
                     }
-                        
                 }
             }
@@ -47,6 +53,6 @@
      */
     public static float getPixelDensity() {
-        int pixelPerInch = getScreenDPI();
-        return (float) (pixelPerInch / 96.0);
+        float pixelPerInch = getScreenDPI();
+        return pixelPerInch / 96f;
     }
 
@@ -66,6 +72,6 @@
     public static int getSizeDpiAdjusted(int size) {
         if (size <= 0) return size;
-        int pixelPerInch = getScreenDPI();
-        return size * pixelPerInch / 96;
+        float pixelPerInch = getScreenDPI();
+        return Math.round(size * pixelPerInch / 96);
     }
 
@@ -77,5 +83,5 @@
     public static float getSizeDpiAdjusted(float size) {
         if (size <= 0f) return size;
-        int pixelPerInch = getScreenDPI();
+        float pixelPerInch = getScreenDPI();
         return size * pixelPerInch / 96;
     }
@@ -88,5 +94,5 @@
     public static double getSizeDpiAdjusted(double size) {
         if (size <= 0d) return size;
-        int pixelPerInch = getScreenDPI();
+        float pixelPerInch = getScreenDPI();
         return size * pixelPerInch / 96;
     }
@@ -98,12 +104,12 @@
      */
     public static Dimension getDimensionDpiAdjusted(Dimension dim) {
-        int pixelPerInch = getScreenDPI();
+        float pixelPerInch = getScreenDPI();
         int width = dim.width, height = dim.height;
         if (dim.width > 0) {
-            width = dim.width * pixelPerInch / 96;
+            width = Math.round(dim.width * pixelPerInch / 96);
         }
 
         if (dim.height > 0) {
-            height = dim.height * pixelPerInch / 96;
+            height = Math.round(dim.height * pixelPerInch / 96);
         }
 
