- Timestamp:
- 2016-06-12T13:27:02+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/GuiSizesHelper.java
r10358 r10360 2 2 3 3 import java.awt.Dimension; 4 import java.awt.HeadlessException; 4 5 import java.awt.Toolkit; 5 6 … … 21 22 synchronized (GuiHelper.class) { 22 23 if (screenDPI == -1) { 23 screenDPI = Toolkit.getDefaultToolkit().getScreenResolution(); 24 try { 25 screenDPI = Toolkit.getDefaultToolkit().getScreenResolution(); 26 } catch (HeadlessException e) { 27 screenDPI = 96; 28 } 29 24 30 } 25 31 } … … 35 41 public static float getPixelDensity() { 36 42 int pixelPerInch = getScreenDPI(); 37 return (float) (pixelPerInch / 96. );43 return (float) (pixelPerInch / 96.0); 38 44 } 39 45
Note:
See TracChangeset
for help on using the changeset viewer.