Changeset 10360 in josm for trunk/src/org


Ignore:
Timestamp:
2016-06-12T13:27:02+02:00 (8 years ago)
Author:
stoecker
Message:

fix unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/util/GuiSizesHelper.java

    r10358 r10360  
    22
    33import java.awt.Dimension;
     4import java.awt.HeadlessException;
    45import java.awt.Toolkit;
    56
     
    2122            synchronized (GuiHelper.class) {
    2223                if (screenDPI == -1) {
    23                     screenDPI = Toolkit.getDefaultToolkit().getScreenResolution();
     24                    try {
     25                        screenDPI = Toolkit.getDefaultToolkit().getScreenResolution();
     26                    } catch (HeadlessException e) {
     27                        screenDPI = 96;
     28                    }
     29                       
    2430                }
    2531            }
     
    3541    public static float getPixelDensity() {
    3642        int pixelPerInch = getScreenDPI();
    37         return (float) (pixelPerInch / 96.);
     43        return (float) (pixelPerInch / 96.0);
    3844    }
    3945
Note: See TracChangeset for help on using the changeset viewer.